I have quite a strange problem...my code looks somewhat like the following to simplify:
the foreach statement is traversing through an array that has $key = category name and $value = category number. In the IF statement $row[4] is the category that the entry belongs in...
$query = \"SELECT * FROM table\";
$result = mysql_db_query.....
foreach($array as $key => $value) {
echo \"Now on Category: $key, $value\n\";
while($row = mysql_fetch_row($result)) {
if ($row[4] == $value) {
echo \"$row[0], $row[1]<br>\n\";
}
}
}
I hope this doesnt seem too confusing...basically what I am doing is grabbing all of the categorys first from another table, dumping those in $array and then making only one query to print all the items instead of doing one query each foreach iteration and keeping down load time. For some reason it is not entering the while loop the second time around...It prints out all the items equal to category 1, but then right after it says \"Now on Category: Cat_name, 2\" it doesnt print out anything as if it never entered the while loop a second time...anyone know why this could be?