LiamH Posted February 24, 2009 Share Posted February 24, 2009 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? Link to comment https://forums.phpfreaks.com/topic/146695-solved-how-to-display-images-with-the-location-stored-in-the-database/ Share on other sites More sharing options...
Stephen68 Posted February 24, 2009 Share Posted February 24, 2009 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? Link to comment https://forums.phpfreaks.com/topic/146695-solved-how-to-display-images-with-the-location-stored-in-the-database/#findComment-770143 Share on other sites More sharing options...
LiamH Posted February 24, 2009 Author Share Posted February 24, 2009 I'm not sure where I went wrong but I used echo "<td><img src=".$row['ImageLocation'].">Image</td>"; which worked Link to comment https://forums.phpfreaks.com/topic/146695-solved-how-to-display-images-with-the-location-stored-in-the-database/#findComment-770148 Share on other sites More sharing options...
Stephen68 Posted February 24, 2009 Share Posted February 24, 2009 Yip! glad it worked out for you Stephen Link to comment https://forums.phpfreaks.com/topic/146695-solved-how-to-display-images-with-the-location-stored-in-the-database/#findComment-770152 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.