j05hr Posted May 19, 2010 Share Posted May 19, 2010 I am being completely stupid but I have no idea how this works. I have done the bit where you upload the image to the database, so the image is in the database as a long blob. How do you pull the image back to get it in the website? I've got this code in my page <div id="picture"><?php echo "<img src='".$sel_subject['image']."'>"; ?><br></div> Thats reads out like, <div id="picture"><img src='image1.jpg'><br></div> Unless i manually put the image1 in the folder then the picture doesn't show up. So how do I actually get it to come from the database? Thanks, Josh Link to comment https://forums.phpfreaks.com/topic/202289-pulling-an-image-from-the-database/ Share on other sites More sharing options...
harkly Posted May 19, 2010 Share Posted May 19, 2010 Try this http://www.wellho.net/mouth/937_Display-an-image-from-a-MySQL-database-in-a-web-page-via-PHP.html Link to comment https://forums.phpfreaks.com/topic/202289-pulling-an-image-from-the-database/#findComment-1060733 Share on other sites More sharing options...
j05hr Posted May 19, 2010 Author Share Posted May 19, 2010 But is this only for one image? <img src=picscript.php?imname=potwoods><br> Seems like it's specific to one image? Link to comment https://forums.phpfreaks.com/topic/202289-pulling-an-image-from-the-database/#findComment-1060749 Share on other sites More sharing options...
harkly Posted May 19, 2010 Share Posted May 19, 2010 You would need to modify the code to fit. You should be able to do something like this <img src=$imageName> Link to comment https://forums.phpfreaks.com/topic/202289-pulling-an-image-from-the-database/#findComment-1060767 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.