List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:September 12 2002 11:56pm
Subject:Re: Problems with a Quote in Select
View as plain text  
>FYI -
>Be careful using dbh->quote with inserts and updates. If you feed dbh->quote a
>variable that has
>no value, it will return '' (tick tick). If the column is a date the 
>value will
>be set to 0000-00-00 and
>if the column is numeric it will be set to 0 instead of NULL .  You can either
>check the length of the variable to see if you
>can quote it, or use a sub_routine like below and  call it instead 
>of dbh->quote.

That is false.  If you feed $dbh->quote() an *empty string*, it will
do what you suggest.  If you feed it undef, quote() will return the word
NULL with no surrounding quotes.  In both cases, quote() is doing the
correct thing.

sql,query
Thread
Problems with a Quote in SelectRenĂ© Fournier13 Sep
  • Re: Problems with a Quote in SelectGerald Clark13 Sep
  • Re: Problems with a Quote in Selectwalt13 Sep
Re: Problems with a Quote in SelectPaul DuBois13 Sep