Canman2005 Posted October 29, 2007 Share Posted October 29, 2007 Hi all I have a simple QUERY, it looks like $sql = "SELECT * FROM mydata WHERE uid = 22"; $show = @mysql_query($sql,$connection) or die(mysql_error()); while ($row = mysql_fetch_array($show)) { print $row['title']; print "<br>"; } I want to print a few full stops (........) after every 3 rows returned. So the results may look like title 1 title 2 title 3 ........... title 4 title 5 title 6 ........... title 7 Can anyone help me? Thanks in advance Dave Link to comment https://forums.phpfreaks.com/topic/75214-print-every-3-rows/ Share on other sites More sharing options...
Barand Posted October 29, 2007 Share Posted October 29, 2007 <?php $i = 0; while ($row = mysql_fetch_array($show)) { print $row['locname']; print "<br>"; if (++$i%3==0) echo '.....................', '<br>'; } Link to comment https://forums.phpfreaks.com/topic/75214-print-every-3-rows/#findComment-380402 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.