-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathview.php
35 lines (27 loc) · 928 Bytes
/
view.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
// Include the database configuration file
require_once 'db_connection.php';
// Get image data from database
//$result = $db->query("SELECT image FROM images ORDER BY id DESC");
$result = $conn->query("SELECT image FROM images ORDER BY id DESC");
?>
<?php if($result->num_rows > 0) { ?>
<div class="gallery">
<?php while($row = $result->fetch_assoc()){ ?>
<!-- The data, charset, and base64 parameters in the src attribute below, are used to display image BLOB from our MySQL database. -->
<img src="data:image/jpg;charset=utf8;base64,<?php echo base64_encode($row['image']); ?>" alt="194x228" />
<?php } ?>
</div>
<?php }
else { ?>
<p class="status error">Image(s) not found...</p>
<?php } ?>
<!DOCTYPE html>
<html>
<head>
<title>Image Upload</title>
<link rel="stylesheet" type= "text/css" href ="css/imagetest.css"/>
<div id="content">
</div>
</body>
</html>