This is my code.
<img src="getimage.php?id=1" alt="Delicious World" />
This is getimage.php
<?php
$id = $_GET['id'];
// do some validation here to ensure id is safe
$link = mysql_connect("localhost", "root", "");
mysql_select_db("db_cupcake");
$sql = "SELECT image FROM item WHERE id=$id";
$result = mysql_query("$sql");
$row = mysql_fetch_assoc($result);
mysql_close($link);
header("Content-type: image/jpeg");
echo $row['0'];
?>
I have directly stored the image in the database. I want to load those images in the webpage. Help me out.