Hi all,
First of all,wish you all a very happy new year.
I have coded the following program where it selects an image name from mysql database and then goes on to print the image from that particular directory.Well,it selects the image name correctly and the query works perfectly.But I am not able to display the image from that particular directory.By the way,the image in the specified directory staff is an uploaded image.Please let me know why the image is not being displayed.
Here's the code:
<form name="personal.php" method="POST" enctype="multipart/form-data">
<?
$db="dbname";
$link=mysql_connect("localhost","USER","PASSWORD") or die("couldn't connect to Mysql");
mysql_select_db($db) or die("Select Error:".mysql_error());
$result2=mysql_query("SELECT * FROM staff")or
die("Select Error:".mysql_error());
$rt=mysql_fetch_array($result2);
$det=$rt['details'];
$image=$rt['image'];
echo $image;
print "<br>";
echo $det;
print "<br>";
?>
<img src="../htdocs/staff/<?=$image?>">
<?
mysql_close($link);
?>
</form>
I would be grateful if you point out my mistake for I am stuck with this problem for a week now.