Hi all,
I am trying to loop through a variable in a mysql call so that the sql call runs once for each value. The call is working for pulling data, but the only item that seems to be able to display is the last value called instead of each of them. Any ideas?
$tmpquery = "WHERE tccategory.id != '0'";
$tccategoryDetail = new request();
$tccategoryDetail->opentccategory($tmpquery);
$compttccategoryDetail = count($tccategoryDetail->tccategory_id);
for ($c=0;$c<$compttccategoryDetail;$c++) {
$tmpquery12 = "WHERE tcsub_category.category_id = '".$tccategoryDetail->tccategory_id[$c]."'";
}
$tcsubcategoryDetail = new request();
$tcsubcategoryDetail->opentcsub_category($tmpquery12);
$compttcsubcategoryDetail = count($tcsubcategoryDetail->tcsub_category_id);
I have tried having the "for" statement control a lot more than just what it is now, but that doesnt work either. The call should be saying where category_id = 1st cat id, where category_id = 2nd cat id, etc...any ideas?