<?php require('conn.php'); /*important, change in conn.php to your settings*/ $id=$_GET['pid']; $query = "SELECT * FROM upload WHERE ID=$id"; $result=mysql_query($query) or die('Error, query failed'.mysql_error()); $row=mysql_fetch_array($result); //imagecreatefromjpeg( $row['name']); header("Content-type:image/jpeg"); stripslashes ($row['content']); echo $row['content']; ?>