Gossamer Forum
Home : Products : DBMan : Installation :

displaying picture

Quote Reply
displaying picture
Hi,

I have some pictures that I want to be added to the database. I have 1650 records in the database, and 75 pictures. The way I want the database to call for the picture is by looking at the Company and category. I could use
Code:
If ( $rec{'Company'} eq 'Microsoft' ) { print qq|<img src="http://www.server.com/picture.gif">
But that will only look in the company. How can I have it look in the company, and the cateogry.

Thank You
Quote Reply
Re: displaying picture In reply to
Code:
If ( ($rec{'Company'} eq 'Microsoft') && $rec{'Category'} eq 'Software') ) {

The other way, if you had a picture for every combination of company and category is to name your .gif files like "MicrosoftSoftware.gif" and then you could just use

print qq|<img src="http://www.server.com/$rec{'Company'}$rec{'Category'}.gif">|;

That would eliminate all of your "if" statements, but would require renaming your files and making sure you had one for each combination.


------------------
JPD