Canman2005 Posted October 19, 2008 Share Posted October 19, 2008 Hi all I have a very simple QUERY, looks like <?php $sql = "SELECT * FROM `users` WHERE `area` = '99'"; $show = @mysql_query($sql,$connection) or die(mysql_error()); while ($row = mysql_fetch_array($show)) { print $row['fullname']; print "<br>"; } ?> This returns a list like David Harry Sarah Richard Shelly Bob Jerry Vicki Shaun How is it possible to insert the word "NEXT" after every 4th row returned, so the above output would look like David Harry Sarah Richard NEXT Shelly Bob Jerry Vicki NEXT Shaun Any help would be great Thanks Ed Quote Link to comment Share on other sites More sharing options...
ghostdog74 Posted October 19, 2008 Share Posted October 19, 2008 you can use a counter while () { $count++; if ( $count == 4 ){ echo "Next\n"; $count=0 } ..... .... } Quote Link to comment Share on other sites More sharing options...
Canman2005 Posted October 19, 2008 Author Share Posted October 19, 2008 Cool, thanks man 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.