either returns nothing, or i also got whitespace problem "Cannot modify header information - headers already sent by ..."
output.php
Code: Select all
<?php
include("config.php");
$query = "SELECT * FROM upload ";
$result = mysql_query($query,$db);
if(mysql_num_rows($result) == 0){
echo "<br>image database empty<br>
no picture was selected<br>";
}
else{
$query = "SELECT * FROM upload";
$result = mysql_query($query);
while($row = mysql_fetch_array($result, MYSQL_ASSOC)){
$img = $row['content'];
//set the header for the image
header('Content-type: image/jpeg');
echo "<img src='$img'>";
//echo "{$row['name']}<br>";
//echo "{$row['size']}<br>";
}
}//end else
?>
any ideas? thanks.