Hey all,
I am trying to do some array looping with php to get some mysql calls to get various data items. The problem is all I seem to be able to pull is the last item that is called from the database instead of the whole range.
This is a category - sub category - custom category hierarchy. I am pulling a list of all categories, then wanting to list all sub categories under those categories, then all custom categories under those specific sub categories. So each call relates to the previous call except the first. My calls are below, any ideas?
$tmpquery = "WHERE tccategory.id != '0'";
$tccategoryDetail = new request();
$tccategoryDetail->opentccategory($tmpquery);
$compttccategoryDetail = count($tccategoryDetail->tccategory_id);
for ($c=0;$c<$compttccategoryDetail;$c++) {
$cat_id[0] = $tccategoryDetail->tccategory_id[$c];
$tmpquery12 = "WHERE tcsub_category.category_id = $cat_id[0]";
$tcsubcategoryDetail = new request();
$tcsubcategoryDetail->opentcsub_category($tmpquery12);
$compttcsubcategoryDetail = count($tcsubcategoryDetail->tcsub_category_id);
for ($b=0;$b<$compttcsubcategoryDetail;$b++) {
$sub_cat_id[0] = $tcsubcategoryDetail->tcsub_category_id[$b];
$tmpquery11 = "WHERE category_custom.sub_category_id = $sub_cat_id[0]";
$listcategory_custom = new request();
$listcategory_custom->opentestcase_custom($tmpquery11);
$comptcategory_custom = count($category_custom->category_custom_id);
}
}