Forum Moderators: coopster
1 result
2 result
3 result
etc
but my do while loop
$counter = "0";
do
{
++$counter;
print ''.$counter.'<a href="?url=singlepic&id='.$myrow[pic_id].'"><img alt="'.$myrow[pic_id].'" src="upload/thumb/th_'.$myrow[pic_id].'.jpg" /></a><br><br>';
}
while ($myrow = mysql_fetch_array($results));
is giving me a blank #1 from the database from some reason, I have the limit set to 10 but it is posting 11, 1 blank and then the 10 I want.
Anyone know how to solve this?
Altogether you are doing the loop 11 times. The answer to your problem may be discarding the do..while loop and using only while() {} loop. It should solve the problem.
$counter = "0";
while ($myrow = mysql_fetch_array($results))
{
++$counter;
print ''.$counter.'<a href="?url=singlepic&id='.$myrow[pic_id].'"><img alt="'.$myrow[pic_id].'" src="upload/thumb/th_'.$myrow[pic_id].'.jpg" /></a><br><br>';
} Happy New Year from
Michal Cibor