kev wood Posted March 19, 2009 Share Posted March 19, 2009 i have a cms built where the user is able to upload an image to go with a story if they want to. the problem that i am hving is that if they choose not to upload an image i get a red cross can stop this from happening Quote Link to comment https://forums.phpfreaks.com/topic/150129-images-in-mysql-db-and-the-red-cross-of-ie/ Share on other sites More sharing options...
AdRock Posted March 19, 2009 Share Posted March 19, 2009 I would do something like <?php if(!empty($row['image'])) { echo '<img src="images/'.$row['image'].'">'; } ?> that way if the field hasn't got an image title in the field don't do the img src btw are you uploading and putting the filename is the database cos this is how it would work? Quote Link to comment https://forums.phpfreaks.com/topic/150129-images-in-mysql-db-and-the-red-cross-of-ie/#findComment-788396 Share on other sites More sharing options...
kev wood Posted March 19, 2009 Author Share Posted March 19, 2009 yes the upload works by storing the file on the server and witting the path to it to a db. thank for the reply anyway. Quote Link to comment https://forums.phpfreaks.com/topic/150129-images-in-mysql-db-and-the-red-cross-of-ie/#findComment-788550 Share on other sites More sharing options...
AdRock Posted March 19, 2009 Share Posted March 19, 2009 did you get it to work? Quote Link to comment https://forums.phpfreaks.com/topic/150129-images-in-mysql-db-and-the-red-cross-of-ie/#findComment-788878 Share on other sites More sharing options...
premiso Posted March 19, 2009 Share Posted March 19, 2009 EDIT: Sorry, missed the original question. You can assign a "no-image" picture to it that is a valid image. That way something is displayed. EDIT: EDIT: And if you tried AdRock's code, please explain why that did not solve the issue, if you would like further help. Quote Link to comment https://forums.phpfreaks.com/topic/150129-images-in-mysql-db-and-the-red-cross-of-ie/#findComment-788889 Share on other sites More sharing options...
kev wood Posted March 20, 2009 Author Share Posted March 20, 2009 sorry i got side tracked yesterday i will put it to the test today. to be honest tho i thought that would do it ne way and went to implement it then had to leave the computer to do other stuff will get bak today tho and mark the solved button it if works. Quote Link to comment https://forums.phpfreaks.com/topic/150129-images-in-mysql-db-and-the-red-cross-of-ie/#findComment-789247 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.