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 Quote Link to comment 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 Quote Link to comment 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? Quote Link to comment 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> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.