Hi! im new to php programming

im trying to output the file image uploaded to a directory in localhost

im using xampp

i tried several things

im unable to get image displayed

it shows only blank page

if not it shows a very small icon which indicates that pic cannot be loaded.

heres my code:

<?php
require_once("includes/connection.php");

$query = "SELECT * FROM images WHERE product_id='1'";
$result = mysql_query($query);

//retrieve record from category table and assign to $row array
while($row = mysql_fetch_array($result))
{

	//$content = $row['image_id'];
	//echo "<img src=C:/xampp/htdocs/images/".$row['image_id'] ."> <br>";
	//echo "<img src=file:///C:/xampp/htdocs/mags/images/".$row[0] ."> <br>";
	//echo "<img src=http://localhost/images/".$row[0] ."> <br>";
	//echo "<img src='http://localhost/images/maps.jpg' />";
	//. $row['tb_image']; 
}
//header('Content-type: image/jpg');
     //echo $content;
?>

Note: all the comment part inside the while are the codes that i have tried already but not getting any success.

hope you can help

thanks in advance

you need the image file name
do

print_r($row);

to find out what $row[x] you need

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.