i want to select images from the database gallery but am failing below is my codes
<?php include 'DBController.php'; $db_handle = new DBController(); ?> <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <link href="style.css" rel="stylesheet" type="text/css"> </head> <body> <div id="gridview"> <div class="heading">Image Gallery</div> <?php $query = $db_handle->runQuery("SELECT * FROM tbimages ORDER BY id ASC"); if (!empty($query)) { foreach ($query as $key => $value) { ?> <div class="image"> <?php if(file_exists($query[$key]["path"])) { ?> <img src="<?php echo $query[$key]["path"] ; ?>" /> <?php } else { ?> <img src="images/delivery.jpg" /> <?php } ?> </div> <?php } } ?> </div> </body> </html>
($query[$key]["path"]))
DBController
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)