while....for....problem

From: Date: Mon, 19 May 2003 13:02:33 +0000
Subject: while....for....problem
Groups: php.general 
Request: Send a blank email to php-general+get-148158@lists.php.net to get a copy of this message
Here is the code: <?php $query = "SELECT number FROM table"; $result = mysql_query($query) or die ("Error in query: $query. " . mysql_error()); while($row = mysql_fetch_object($result)) { $number= $row->number; ?> some html <?php $e=($number+1)/15; $c=ceil($e); for ($i >= '0'; $i <= $c; $i++) { $d=($i-1)*15; ?> <a href="link.php?offsef=<?=$d;?>"><?=$i;?></a> <? } ?> some html <? } ?> Problem is in the 'For' part. It doesn't print all '$i', only for the first while loop. TNX

« previous php.general (#148158) next »