Jump to content

Displaying an image based on the value in the database?


Solarpitch

Recommended Posts

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%3E

As 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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.