# Newb needs help

**URL:** <https://forum.kirupa.com/t/newb-needs-help/241292>\
**Category:** Uncategorized\
**Created:** [October 11, 2007, 9:03pm UTC](https://forum.kirupa.com/t/newb-needs-help/241292 "2007-10-11T21:03:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dali](https://avatars.discourse-cdn.com/v4/letter/d/c68b51/32.png) [@Dali](https://forum.kirupa.com/u/Dali)\
**Post date:** [October 11, 2007, 9:03pm UTC](https://forum.kirupa.com/t/newb-needs-help/241292/1 "2007-10-11T21:03:30Z")

</div>

Might be basic stuff i’m asking for, but i couldn’t find a solution to the silly problem, so please help 🙂  
I want to show products for online store (pic, info, price - from mysql), lets say 3 products on each row. Just couldn’t think of a way to make the php loop the html tags exactly after each 3 posts from mysql. Have no problem getting the info from mysql and get the products 1 in a row - as i have it now:  
$query = “SELECT \* FROM productinfo”;  
$result = mysql\_query ($query)  
or die (“Couldn’t execute query.”);

while ($row = mysql\_fetch\_array($result))

{  
echo "\<tr\>  
\<td\>  
\<table\>  
\<tr\>\<img src=’{$row[‘pic’]}’\>\</tr\>\<br\> \<tr\>{$row[‘info’]}\</tr\>\<br\> \<tr\>{$row[‘price’]}\</tr\>  
\</table\>  
\</td\>\</tr\>  
";  
}
