I have a DB working where imgs are stored in the DB and I do not want that but can't get it to work with the filename. The code is in 2 different files..
My first one - -
<?php
header("Content-type: image/jpeg");
$prodid = $_GET['id'];
$con = mysql_connect("localhost", "test", "test") or die('');
mysql_select_db("store", $con);
$query = "SELECT image from products WHERE prodid = $prodid";
$result = mysql_query($query);
$row = mysql_fetch_array($result, MYSQL_ASSOC);
$picture = $row['prodid'];
echo $picture;
?>
2nd one - -
while($row=mysql_fetch_array($result, MYSQL_ASSOC))
{
$prodid = $row['prodid'];
$description = $row['description'];
$image = $row['pic'];
echo "<tr><td>$prodid</td><td>$description</t...
echo "<td><img src=\"showimage.php?id=$prodid\" width=\"80\" height=\"60\"></td></tr>\n";
echo "<td><img src=\"images/'$pic'\" width=\"80\" height=\"60\"></td></tr>\n";
}
The 1st img src worked fine and I modified the file for the 2nd one but it will not display.
I also tried these 2 -
echo "<img src=\"images/" . $pic . "\">" ;
printf ("<img src=\"images/%s\">", $pic );
I am just starting coding and am at a loss.