-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlistImages.php
More file actions
24 lines (23 loc) · 836 Bytes
/
listImages.php
File metadata and controls
24 lines (23 loc) · 836 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
// Gets all image id in the database
$sql = "SELECT imageId, imageData FROM tbl_image ORDER BY imageId DESC";
$stmt = $conn->prepare($sql);
$stmt->execute();
$result = $stmt->get_result();
?>
<?php
// Show all images from the database one by one for reducing overcharge
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
// Show only images that contain imageData in the database
if($row["imageData"]){
// <img src="data:image/jpg;charset=utf8;base64,<?php echo base64_encode($row['imageData']); " />
?>
<?php ?>
<!--- Display uploaded blob images in a gallery --->
<img src="imageView.php?image_id=<?php echo $row["imageId"];?>">
<?php
}
}
}
?>