I have some code that works and successfully displays some results based on an SQL query. These results are displayed in row format, however I would like to display them in columns.
Currently the results are displayed as follows
Item Details Item Details Item Details However I would like each result in it's own colums like so;
Item Details Item Details Item Details What should I change in order to do this? Do I need another foreach loop, or do I need to echo the <div class="col-md-4 col-sm-6"> and </div>
My current code is as follows.
<div class="row"> <div class="col-md-4 col-sm-6"> <?php foreach ($this->popularBook as $popularBook) { echo 'Item Details'; } ?> </div> <div class="col-md-4 col-sm-6"> <p>Item Details</p> </div> <div class="col-md-4 col-sm-6"> <p>Item Details</p> </div> </div> Quite new to SQL and php so any advice/direction is greatly appreciated.