kisazeky Posted April 17, 2009 Share Posted April 17, 2009 I have a loop code that grabs data from the database and lists it on a webpage. $article_title = "Shop"; $article_content = "Shop description goes here.<table<tr>"; $query = "SELECT * FROM adoptables WHERE kind = 'shop'"; $result = mysql_query($query); $num = mysql_numrows($result); //Loop out code $i=0; while ($i < $num) { $aID=@mysql_result($result,$i,"uid"); $name=@mysql_result($result,$i,"name"); $imageurl=@mysql_result($result,$i,"imageurl"); $cost=@mysql_result($result,$i,"description"); //Content output $article_content=$article_content."<td>".$name."<p><img src='".$imageurl."'/><p>".$cost." <p><a href='buy.php?aID=".$aID."'>Buy ".$name."</a></td>"; $i++; } $article_content=$article_content."</tr><tr>"; I want to arrange the data in table columns, with 5 items per row. How can I accomplish this? Quote Link to comment Share on other sites More sharing options...
ober Posted April 17, 2009 Share Posted April 17, 2009 http://www.phpfreaks.com/forums/index.php/topic,95426.0.html 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.