Hi,
Can someone help me, I'm a real newbie to this! I'm trying to save a link to a picture in mysql and then load the picture on a webpage,it's a product catalog. In the Image_Loc column I just have pic1.jpg as the link name and then I was putting the image in the folder c:\phpdev\pics and just using <img src=/phpdev/pics/$Image_Loc /> to call the pictures.
Code below, I have changed it a few different ways, but everything I tried just gives a box with an X as if the picture doesn't exist. I tried giving it full address i.e.: http://localhost/Pics/$image_loc etc. still no joy
PHP Code:
<?php 
$connection 
mysql_connect("localhost""root""") or die ("Couldn't connect to server.");
$db mysql_select_db("XYZPrint"$connection) or die ("Couldn't select database");
$sql "SELECT Product_ID, Title, Image_Loc
    FROM Products"
;
$sql_result mysql_query($sql$connection) or die ("Couldn't execute query.");

// start results formatting
echo "<table border=1>";
echo 
"<TR><TH>Product ID</TH><TH>Title</TH><TH>Picture</TH></TR>";
while (
$row mysql_fetch_array($sql_result)) {
$product_id $row["Product_ID"];
$title $row["Title"];
$Image_Loc $row["Image_Loc"];
echo 
"<TR><TD>$product_id</TD><TD>$title</TD><TD><img src=http://localhost/phpdev/Pics/$Image_Loc</img></TD></TR>";
}
echo 
"</TABLE>";
mysql_free_result($sql_result);
mysql_close($connection);
?>
Thanks In Advance!!!