kizzie Posted October 11, 2009 Share Posted October 11, 2009 Pls i really need help with storing images in a database.I created a field in the database named 'PICS' with type as 'blob'. But i dont know whether the image file path should be stored in the database then the image itself stored in a folder or if the image should be stored in the database.And also how do i echo the image? I really need this script pls. Thanks... Waiting... Link to comment https://forums.phpfreaks.com/topic/177316-help-with-storing-images-in-a-database-and-echoing-it-on-a-page/ Share on other sites More sharing options...
xxmart Posted October 11, 2009 Share Posted October 11, 2009 Just make a folder on your webserver called images. example database : Id | URL -------- 0 | images/image1.jpg 1 | images/image2.jpg $conn = mysql_connect(localhost, user, password) or die ('Error connection to mysql'); mysql_select_db(dbname) or die (mysql_error()); while($row = mysql_fetch_array($result)){ echo "<img src='". $row['url'] . "' width='500' height='200'>"; } Link to comment https://forums.phpfreaks.com/topic/177316-help-with-storing-images-in-a-database-and-echoing-it-on-a-page/#findComment-934885 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.