Gossamer Forum
Home : Products : DBMan : Customization :

Checking the content of a database field

Quote Reply
Checking the content of a database field
Heya JPDeni,

I guess this is more a Perl than DB question but I'm going to ask anyway....

How do I check the exact content of a field with and IF statement?

I tried:

Code:
if ($rec{'Country'} == 'United States')

But don't seem to get the correct results. Where am I going wrong?





------------------
Safe swoops
Sangiro

http://www.dropzone.com/
Quote Reply
Re: Checking the content of a database field In reply to
For strings, you need to use eq.

Code:
if ($rec{'Country'} eq "United States") {



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