Hello Reader's! If you have stored the image in database as blob. Then you need a php code to retrieve them and a html page to show them. Lets see an example below how to show them
First create a php page getImage.php and code as written below:-
<?php
$id = $_GET['id'];
$link = mysql_connect("localhost", "root", "");
mysql_select_db("dvddb");
$sql = "SELECT dvdimage FROM dvd WHERE id=$id";
$result = mysql_query("$sql");
$row = mysql_fetch_assoc($result);
mysql_close($link);
header("Content-type: image/jpeg");
echo $row['dvdimage'];
?>
Now create html page and make php code to call your image :-
<body>
<img src="getImage.php?id=1" width="175" height="200" />
</body>
0 Comment(s)