blagojkk 0 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 Link to post Share on other sites
artacus 0 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] Link to post Share on other sites
fenway 21 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. Link to post Share on other sites
Recommended Posts
Archived
This topic is now archived and is closed to further replies.