Jump to content

Create image grid via a while loop


Mekaboo

Recommended Posts

Hey☺️

Would like to place this code within a grid to make it look more like a photo gallery:

```

<?php
    require_once "db.php";
    $sql = "SELECT imageId FROM output_images ORDER BY imageId DESC";
    $result = mysqli_query($conn, $sql);
 
  while($row = mysqli_fetch_array($result)) {
?>   
        <div class="container">
                <img src="imageView.php?image_id=<?php echo $row["imageId"]; ?>" /><br/>
            </div>

```

 

Right now the images look like a regular column..would prefer they be shown horizontal/vertical rather than just vertical.

 

Thank ya💙

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...