blagojkk Posted December 12, 2006 Share Posted December 12, 2006 I have one table in the mysql database. I want to setup a field that links to an image on my server so I need someone to tell me how to set up the field and make the link entry? After that I heed to display that image using this link in a web browser with some PHP form. For examle my databse name is 'imagedb', my table name is 'imagetbl' and my field name is fieldimg'. My image is in /var/www/html/images/image1.jpg.Thanks Quote Link to comment Share on other sites More sharing options...
artacus Posted December 13, 2006 Share Posted December 13, 2006 Well don't link to the local filesystem. You need to link either relative to the current directory or the root of your webserver. I'd probably only store the actual file name if they are all going to be in images/[code]if($row['fieldimg']) { $img = "<img src='/images/$row[fieldimg]'>";} }[/code] Quote Link to comment Share on other sites More sharing options...
fenway Posted December 15, 2006 Share Posted December 15, 2006 Agreed -- you can always store the path somewhere else in the DB, or hard-code it somewhere. 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.