Hi,
Okay, first we need to select the correct category. Since we're sending the categories name, and not the number, in the url, we need to know how our url is being formatted.
For example:
list.test-1.php?category=*CATEGORY NAME*
For this example, we'll assume this is how it's being done.
Step 1, select the correct category:
list($service_categoriesRecords, $service_categoriesMetaData) = getRecords(array(
'tableName' => 'service_categories',
'where' => "category_name='".mysql_escape(@$_REQUEST['category'])."'"
));
if($service_categoriesRecords){
$category=$service_categoriesRecords[0];
}
else{
echo "Category Not Found";
exit;
}
Next we need to select the correct service title records based on the category number of the category we selected:
list($service_titlesRecords, $service_titlesMetaData) = getRecords(array(
'tableName' => 'service_titles',
'where' => "category=".intval($category['num']),
'perPage' => '10',
));
We now have all of the service_title records associated with that category stored in $service_titlesRecords.
So, we can output the category information like this:
<?php echo $category['category_name'];?>
<?php echo $category['summary];?>
And we can output all the service title information like this:
<?php foreach($service_titlesRecords as $service_title): ?>
<?php echo $service_title['service_title']; ?>
<?php echo $service_title['description'];?>
<?php endforeach ?>
Give this a try and let me know how it works out for you.
Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/