jackie11 Posted January 16, 2007 Share Posted January 16, 2007 Hi everyone, I am new to this forum and in fact new to mysql in general (I'm one of those complete novices everyone hates ha ha !!!!). I am having some trouble displaying pictures which I have saved in my db, after a LOT of research and following advise I have saved the picture in my db as URL's (for example:http://127.0.0.1/jackie/pics/samuel_finlay.jpg)but I can't seem to get them to display on the page the script I have used is:<html><head><title>Employee Index</title></head><body> <h1><img src="etc/Logo_pic_2.JPG"></h1><table cellspacing='10'width="10" font style="font-family: Tahoma;" size="2" ><tr><td colspan='25'><hr></td></tr> <td><B>ID</td> <td><B>Surname </td> <td><B>Forename</td> <td><B>Job Title</td> <td><B>Office Location</td> <td><B>Telephone</td> <td><B>Email</td> <td><B>Expertise</td> <td><B>Hobbies</td> <td><B>DOB</td> <td><B>Picture</td></B> </table><?phpmysql_connect("localhost", "root", "") or die(mysql_error());mysql_select_db("employee index") or die(mysql_error());$query = "SELECT * FROM `employee details`";$result = mysql_query($query)or die (mysql_error()); echo "<table cellspacing='15'>"; echo "<tr><td colspan='20'><hr></td></tr>"; while ($row = mysql_fetch_array($result)) { extract($row); echo " <td>$Employee_ID</td>\n <td>$Surname</td>\n <td>$Forename</td>\n <td>$Job_title</td>\n <td>$Office_location</td>\n <td>$Telephone</td>\n <td>$Email</td>\n <td>$Expertise</td>\n <td>$Hobbies</td>\n <td>$DOB</td>\n <a href='{$row['url']}'>Click me!</a>"; echo "<img src='{$row['img_url']}' alt='' />"; echo "<tr><td colspan='20'><hr></td></tr>\n"; } echo "</table>\n"; ?></body></html>I am also looking to allow people to upload a picture using a form and saving it to a file on the server whilst saving a url of where it is on the db so it can be displayed in the page above for example. Hope I'm not confusing you all!I have been working and trolling the net for 3 full days trying to do thisso any help would be most appricated, but please bear in mind I am a novice and currently pregnant (pregnanacy really does affect your brain!!!) so keep it simple. Hope someone can helpMany Thanks for your timeJackie Link to comment https://forums.phpfreaks.com/topic/34463-please-please-please-help/ Share on other sites More sharing options...
scott212 Posted January 16, 2007 Share Posted January 16, 2007 using your current setup - does the page load end up giving you an error or just not displaying it at all? If it at least shows the page, view the source of the page and look at what the it is spitting out. That should help you narrow it down or post it up here if you can't get it (just the relevant parts). If it gives you an error - tell us that too. Link to comment https://forums.phpfreaks.com/topic/34463-please-please-please-help/#findComment-162423 Share on other sites More sharing options...
JasonLewis Posted January 16, 2007 Share Posted January 16, 2007 i don't really understand your html table setup. your not even opening a <td> tag in some places and stuff is appearing outside of it and it is all weird. Link to comment https://forums.phpfreaks.com/topic/34463-please-please-please-help/#findComment-162430 Share on other sites More sharing options...
jackie11 Posted January 17, 2007 Author Share Posted January 17, 2007 Hi there Thanks for your replies, in answering your question yes the page does display and all the fields from the database displays, however the picture does not but just displays a box with red cross, no error messages are displayed. I know my HTML is not right but I can fix that, I just really want to get the pictures displaying firstHope this clarifiesThanks to you all again Jackie Link to comment https://forums.phpfreaks.com/topic/34463-please-please-please-help/#findComment-162689 Share on other sites More sharing options...
jackie11 Posted January 17, 2007 Author Share Posted January 17, 2007 Hi all all is ok NOW, I have managed to get the pictures to display Thanks anyway for your helpJackie Link to comment https://forums.phpfreaks.com/topic/34463-please-please-please-help/#findComment-162750 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.