zgkhoo Posted November 15, 2007 Share Posted November 15, 2007 mysql data must fetch by while loop? eg. while($row = mysql_fetch_array($result,MYSQL_ASSOC)){ can i use for loop instead of while loop? thanks in advance Quote Link to comment Share on other sites More sharing options...
kopytko Posted November 15, 2007 Share Posted November 15, 2007 Yes, you can use for loop. Like this: <?php $res = mysql_query("select * from table"); for($i=0,$count=mysql_num_rows($res);$i<$count;$i++) { print_r(mysql_fetch_assoc($res)); echo '<br />'; } ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.