Jump to content

[SOLVED] How to display images, with the location stored in the database


LiamH

Recommended Posts

Hi all.

 

My server has a separate images folder that holds any images to be used on the site. I have a table that contains a column that holds image data for that row. So it has the location of the image, with an example being /images/newimage.jpeg.

 

How can I display this image using that location stored in the database?

Not sure what you are looking for here? can't you just query the db for the locations and echo out the image tag?

 

$query = "SELECT * FROM image_table";

$result = mysql_query($query);

 

while ($row = mysql_fetch_array($result)) {

      echo "<img src=\"".$row['image_lcation']."\"  width=\"178\" height=\"76\" border=\"0\">";

}

 

or something like that?

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.