I want my php submissions to be viewed in 3 columns horizontally (example attached - I do not want to use a table)
I am not sure where I went wrong in my code but right now I am getting a white page without an error message. I would like to have 3 columns instead of all my submissions showing in a straight line.
<?php // Create connection $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } $sql = "SELECT id, name, website, url, email, date, description FROM basic"; $result = $conn->query($sql); if ($result->num_rows > 0) { // output data of each row $i = 0; // Set this to 0, since php is 0 based $cols = 3; // Number of cols you want while($row = $result->fetch_assoc()) { if($i % $cols == 0) //Col Code echo "ID: ". $row["id"]. "
Name: ". $row["name"]. "
Email: " . $row["email"] . "
URL: ".$row["url"]."
Launch Date: " . $row["date"] . "
Announcement: " . $row["description"]. "