$sql = "SELECT * FROM posts"; $query = $db->prepare($sql); $query->execute(); <table> <tr> <?php do { //horizontal looper?> <td> <div>id</div> <div>title</div> <div>body</div> <div>date</div> </td> <?php $row = $query->fetch(PDO::FETCH_ASSOC); if (!isset($nested_List)) { $nested_List= 1; } if (isset($row) && is_array($row) && $nested_List++%3==0) { echo "</tr><tr>"; } } while ($row); //end horizontal looper ?> </table>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)