Hey guys i'm using this code
if(!$row = mysql_fetch_array($catQuery, MYSQL_BOTH))
$images->showError();
else while($row)
print $row['category'].'<br>';
and my script is showing only one DB entry and repeat it forever.
Started on the old forum in July 2011 · view the original in the archive · old links redirect here
Hey guys i'm using this code
if(!$row = mysql_fetch_array($catQuery, MYSQL_BOTH))
$images->showError();
else while($row)
print $row['category'].'<br>';
and my script is showing only one DB entry and repeat it forever.
Thanks bro, The solution was
while($row = mysql_fetch_array($catQuery, MYSQL_BOTH))
Even though i still don't understand it but yeah it solved my problem
while(resource) => while the resource exists (infinite loop when you dont delete from resource) while($row = resource) => while the resource is copied to variabile $row while($row == resource) => while resource is equal with row
PS: use MYSQL_ASSOC OR MYSQL_NUM instead MYSQL_BOTH