> -----Original Message----- > From: amonotod [mailto:[EMAIL PROTECTED] > Sent: 20 September 2004 17:09 > To: NIPP, SCOTT V (SBCSI); [EMAIL PROTECTED] > Subject: Re: MySQL data matching error... [snip] > 1) if you're using place-holders, assign undef() to the value, and > the DBI *should* convert it to NULL. > > if ( > ($myVal) #Is it defined? > & > (($myVal eq '') or ($myVal eq ' ') ) #But blank? > ) > { $myVal = "NULL"; } [snip]
Avoid doing this, it's bad practice and won't do what you expect. Check for defined variables using defined() - (in your code above, $myVal will return false if defined but having an empty or 0 value...) if (defined($myVal) && ($myVal eq '' || $myVal eq ' ')) -- Dan Hopkins