andrew_biggart Posted March 1, 2009 Share Posted March 1, 2009 Im trying to display profile pictures of each user from a database but the picture does not load up, when the page loads the td that holds the image goes to 100px x 100px but then back down to 0 again so its like its trying to display it and cant find it. Is this the correct way to display an image from a database? <? echo "<img src='Profile_pics/". $rows['Profile_picture'] . "' style='width:100px; height:100px;' />";?> the row the image names are held in the database is definitly called, Profile_picture and the folder where the images are held is called Profile_pics so i really dont know!! any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/147441-solved-display-images-from-a-databse/ Share on other sites More sharing options...
daviddth Posted March 1, 2009 Share Posted March 1, 2009 I have built queries the same way, except swapping the ' and " about. echo '<img src="'.$searchcem.'/'.$imageid.'.JPG" height="100" width="100">'; If that does not help (I have always used " in html tags like this) then double check capatilisation of directories & filenames Quote Link to comment https://forums.phpfreaks.com/topic/147441-solved-display-images-from-a-databse/#findComment-773860 Share on other sites More sharing options...
andrew_biggart Posted March 1, 2009 Author Share Posted March 1, 2009 i dont understand whats going on to be honest ive used this on my old site and it worked fine so why wont it work on this one grrrrrrr Quote Link to comment https://forums.phpfreaks.com/topic/147441-solved-display-images-from-a-databse/#findComment-773873 Share on other sites More sharing options...
wildteen88 Posted March 1, 2009 Share Posted March 1, 2009 What is outputted to the browser (Right click View Source). What does $rows['Profile_picture'] contain? Quote Link to comment https://forums.phpfreaks.com/topic/147441-solved-display-images-from-a-databse/#findComment-773876 Share on other sites More sharing options...
daviddth Posted March 1, 2009 Share Posted March 1, 2009 Do you have a link to the problem page at all? We might be able to see something in the source. Quote Link to comment https://forums.phpfreaks.com/topic/147441-solved-display-images-from-a-databse/#findComment-773879 Share on other sites More sharing options...
andrew_biggart Posted March 1, 2009 Author Share Posted March 1, 2009 dont worry guys i have got it working now! it ended up being this <img src='../Profile_pics/". instead of this <img src='Profile_pics/". Thanks for all your help tho Quote Link to comment https://forums.phpfreaks.com/topic/147441-solved-display-images-from-a-databse/#findComment-773881 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.