Repeat Region

Codes here !

Moderators: egami, macek, gesf

Post Reply
huntsman69
New php-forum User
New php-forum User
Posts: 1
Joined: Sat Jul 01, 2017 10:15 am

Sat Jul 01, 2017 10:36 am

Hi,

I have set up a database to hold kittens for sale. The database is reading the database details ok, kitten name, sex and DOB. The problem I have is that at the moment it is printing and repeating all the database info in one big div in one long column. Each div needs to repeat horizontally across the page. I possibly think the div needs something like a do while loop on the outside of col-md-4 div but unsure how to go about it or the syntax. Here is how my divs are set up.

<div class="col-md-4">
<div class="gallery">

<?php
My php info here
?>

</div>
</div>

Hope someone can help.

User avatar
hyper
php-forum Active User
php-forum Active User
Posts: 498
Joined: Mon Feb 22, 2016 5:52 pm

Sat Jul 01, 2017 1:58 pm

You are correct when you say that you need to create some sort of loop, assuming you are using PDO (which you should be; if not then start using it now) you can iterate through the results using fetch.

Post Reply