PDA

View Full Version : Displaying category selections in pre-determined to implement Business Directory


jcimb
04-09-2010, 02:44 PM
I have implemented the EPC here as a Member Business Directory: http://www.nvfpc.org/findaprofessional.php

Now I would like to list it sorted by business type. So I think I would take the category 'Members' and create selections such as Assisted Living, Caregivers, Financial Services, etc.
To show the list, I would have repeated lines of code where I would change the category ($showCat) then call calendar.php repeatedly such as: (assume for now that other variables would be set also)

<p>Assisted Living</p><?php
$showCat="a|2|6";
$template="mytemplate.php";
require ("calendar/calendar.php");
?><p>Caregivers</p><?php
$showCat="a|2|8";
$template="mytemplate.php";
require ("calendar/calendar.php");
?>etc.

Questions: Is this a good way to implement this?
Would this adversely affect the server by having repeated calls to the database?

Brian
04-09-2010, 04:33 PM
You can do it this way. It would depend on your server and if it's capable of the multiple SQL calls in an efficient manner. I think you'd just need to try it to see.