Page 1 of 1

displaying image using a name stored in mysql database.

Posted: Sun Jul 22, 2007 12:05 pm
by roondog
I am trying to make a news page with a picture for each news item. I have uploaded the picture and inputed the news story to the database. I'm having trouble displaying the image. I'm using this at the moment:

echo "<img src=".$row['imgname'];" />";

but i need to add ./images/ to it. I've tried

echo "<img src=""./images/".$row['imgname'];" />"; but to no avail.

the top code displays a box where an image should be.

any ideas?

Posted: Sun Jul 22, 2007 12:26 pm
by ianhull
try ../images

Posted: Sun Jul 22, 2007 12:44 pm
by roondog
I've managed to get the imgname to be in the database as ./images/**.jpeg so when i call the image
i use echo "<img src=".$row['imgname']." />"; which seems to be working. Thanks for the help though.