Hi
I have tried to figure this problem out, and have narrowed it down to a string not being passed to an if() conditional nested in a for() loop. Thing is, I cannot for the life of me see why it is so...
simple code:
echo $dept_id;
// $dept_id==2
for ($i=0; $i<$numcats; $i++) {
echo echo $dept_id;
//$dept_id==2
if ($cats[$i]["dept_id"]==$dept_id) {
echo "<br>catname=".$cats[$i]["cat_name"];
//this is not echoed
}
}
The thing is, if I add
if ($cats[$i]["dept_id"]==2
the if statement equates, and executes
ehm, why?
any ideas appreciated!