I have a script im working on for a project, I would like to obtain information from the database through my PDO connection. What i would like to achieve is the following:
Basically its a eCommerce template where you view the products on the page, each row can only show 3 products at a time (template style). So for short i would like to achieve that 3 products is shown per row (if there is more than 3 products per category, it should create a another loop to display the other products in the next row "template style").
Here is the template i am using:
<div class="top-box">
<div class="col_1_of_3 span_1_of_3">
<a href="single.html">
<div class="inner_content clearfix">
<div class="product_image">
<img src="images/pic.jpg" alt=""/>
</div>
<div class="sale-box"><span class="on_sale title_shop">New</span></div>
<div class="price">
<div class="cart-left">
<p class="title">Lorem Ipsum simply</p>
<div class="price1">
<span class="actual">$12.00</span>
</div>
</div>
<div class="cart-right"> </div>
<div class="clear"></div>
</div>
</div>
</a>
</div>
<div class="col_1_of_3 span_1_of_3">
<a href="single.html">
<div class="inner_content clearfix">
<div class="product_image">
<img src="images/pic1.jpg" alt=""/>
</div>
<div class="price">
<div class="cart-left">
<p class="title">Lorem Ipsum simply</p>
<div class="price1">
<span class="actual">$12.00</span>
</div>
</div>
<div class="cart-right"> </div>
<div class="clear"></div>
</div>
</div>
</a>
</div>
<div class="col_1_of_3 span_1_of_3">
<a href="single.html">
<div class="inner_content clearfix">
<div class="product_image">
<img src="images/pic2.jpg" alt=""/>
</div>
<div class="sale-box1"><span class="on_sale title_shop">Sale</span></div>
<div class="price">
<div class="cart-left">
<p class="title">Lorem Ipsum simply</p>
<div class="price1">
<span class="reducedfrom">$66.00</span>
<span class="actual">$12.00</span>
</div>
</div>
<div class="cart-right"> </div>
<div class="clear"></div>
</div>
</div>
</a>
</div>
<div class="clear"></div>
</div>
The fist 3 products must be as the code above, then loop if there is more products with the same style.