PLz Help
i have some Images in DataBase in Blob field
but images are displayed with a Cross (X) not the actual image
MainPage.php//code
plz help me
i have some Images in DataBase in Blob field
but images are displayed with a Cross (X) not the actual image
MainPage.php//code
Code:
<?php $con = mysql_connect("localhost","root",""); if (!$con) die('Could not connect: ' . mysql_error()); mysql_select_db("db1", $con); $image = mysql_query("SELECT * FROM userimagetable"); while($imageResult = mysql_fetch_array($image) ){ ?> <img src="ViewImage.php?id=<?=$imageResult['id']?>" alt="Picture" /></td></tr> <?php } and the other file displaying image code is ViewImage.php <?php $id = $_GET['id']; $image = mysql_query("SELECT * FROM userimagetable WHERE Id='".$id."'"); $imageResult = mysql_fetch_array($image); header("Content-type: image/jpg"); echo $imageResult['UserImage']; ?>
Comment