Woodburn2006 Posted August 5, 2006 Share Posted August 5, 2006 i am getting results from a database and i want there to be 3 results on each row, so that when 3 results have been displayed it creates a new line and displays the next 3 results there. i have tried but cannot seem to do it. this is the code that i tried with:[code]<table width='150' border='0' cellspacing='2' cellpadding='0'><tr> <?$cell_count = 0;while ($row = mysql_fetch_array($result)) { if ($cell_count % 2){ extract($row); $price = "£$price"; echo "</tr><tr>"; $cell_count++;}else{echo " <td><div align='center'><img name='' src='' width='150' height='150' alt='' style='background-color: #CCCCCC'></td>";$cell_count++;}}?> </tr></table>[/code]anyone know how i can solve this? Link to comment https://forums.phpfreaks.com/topic/16652-new-row-after-3-results/ Share on other sites More sharing options...
redarrow Posted August 5, 2006 Share Posted August 5, 2006 http://www.php-mysql-tutorial.com/php-mysql-paging.phpuse this linl an see the example how to inplement the pagginton Link to comment https://forums.phpfreaks.com/topic/16652-new-row-after-3-results/#findComment-69888 Share on other sites More sharing options...
Woodburn2006 Posted August 5, 2006 Author Share Posted August 5, 2006 ok thanks, but i fail to see how i can use it.i want 3 images on each row.thanks Link to comment https://forums.phpfreaks.com/topic/16652-new-row-after-3-results/#findComment-69891 Share on other sites More sharing options...
ronverdonk Posted August 5, 2006 Share Posted August 5, 2006 We have had this topic twice over the last 2 days. See threads [url=http://www.phpfreaks.com/forums/index.php/topic,102715.0.html]http://www.phpfreaks.com/forums/index.php/topic,102715.0.html[/url] and [url=http://www.phpfreaks.com/forums/index.php/topic,103051.0.html]http://www.phpfreaks.com/forums/index.php/topic,103051.0.html[/url] Link to comment https://forums.phpfreaks.com/topic/16652-new-row-after-3-results/#findComment-69896 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.