I'm having an issue displaying an image from a db
I have uploaded an image to a folder and have saved the path in a mysql database. I now wish to be able to display the image within a browser
I tried using <img src="<?=path;?>"> to display each image but it hasn't worked
<?php
include 'config.php';
$query = "SELECT path FROM upload2";
$result = mysql_query($query) or die('Error, query failed');
if(mysql_num_rows($result) == 0)
{
echo "Database is empty <br>";
}
else
{
while(list($path) = mysql_fetch_array($result))
{
?>
<img src="<?=path;?>">
<?php
}
}
?>
any ideas?