JTapp Posted May 6, 2008 Share Posted May 6, 2008 Yeah.. umm.. I might be dreaming. Here is a fictitious explanation of what I would like to do: field #1 is a company number (field name = companyID) field #2 is a field that was designed to hold a photo (field name = PhotoPath) I have over 300 company photos stored on my server that are named by the company number (ie, company #1 is named 1.jpg) I was going to manually go into field #2 and type in a hyperlink to the location of the photo on the server using the following line of code in my PHP: echo "<img src='{$row['PhotoPath']}'>"; Now I'm wondering if I can have an echo line that combines - location where photos are on my server, Field #1 and .jpg to generate a hyperlink. Bypassing the need for my field #2. Hope this makes sense... Link to comment https://forums.phpfreaks.com/topic/104302-solved-merge-data-from-two-fields-to-create-a-hyperlink/ Share on other sites More sharing options...
Fadion Posted May 6, 2008 Share Posted May 6, 2008 If im getting this right, u need: <?php $imagesFolder = 'images/companies/'; echo "<img src='" . $imagesFolder . $row['companyID'] . ".jpg' />"; ?> Link to comment https://forums.phpfreaks.com/topic/104302-solved-merge-data-from-two-fields-to-create-a-hyperlink/#findComment-534069 Share on other sites More sharing options...
JTapp Posted May 6, 2008 Author Share Posted May 6, 2008 Worked beautifully! Thanks for taking the time! Link to comment https://forums.phpfreaks.com/topic/104302-solved-merge-data-from-two-fields-to-create-a-hyperlink/#findComment-534092 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.