Solarpitch Posted January 24, 2007 Share Posted January 24, 2007 Hey Guys,I have an application that will allow the user to upload up to 3 images of a product they want to sell. When the results are called in a table I want to display a camera icon in the rows that have images uploaded.For an example of a site that implements this you can see:http://www.carzone.ie/usedcars/index.cfm?fuseaction=search&maxrows=100&MakeID=31&xMakeID=31&ModelID=262&xModelID=262&Year=&xYear=&submit=Find+cars+%3E%3EAs you can see the above image display a camera icon in the photo column for all ads that have images. How can I achieve this?The file are being stored in a folder and the paths in the DB.I suppose I will have something like[code]echo "<td id = 'table_style' width = 85><img src=".$camera_image." style='border: 1px solid rgb(0, 0, 0);' border='0' width='40' /></td>";[/code]So bascially, I want to show the camera image based on whether 1 of the 3 image variables are set ($image_path1, $image_path2, $image_path3)Thanks guys. Link to comment https://forums.phpfreaks.com/topic/35552-displaying-an-image-based-on-the-value-in-the-database/ Share on other sites More sharing options...
The Little Guy Posted January 24, 2007 Share Posted January 24, 2007 try an if statement (just an example):if($ow['pic']!=''){ echo'<td><img src="'.$camer_image.'"></td>';}else{ echo'<td> </td>';} Link to comment https://forums.phpfreaks.com/topic/35552-displaying-an-image-based-on-the-value-in-the-database/#findComment-168322 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.