in reply to DBI quoting when I don't want it to
1) you are using an INSERT statement with a WHERE clause. Are you sure you don't want UPDATE?
UPDATE table SET thisdate='2002-12-25' WHERE id=1;
2) Single quotes can cause problems since they can be used to quote literals. Try this:
Then using your DBI method,if ( ($DATE =~ /month/) || ($DATE =~ /day/) ) { $statement = "DATE(NOW()+ INTERVAL $DATE)"; } else { $statement = "$DATE"; #assumes YYYY-MM-DD }
INSERT into table (thisdate) VALUES ("$statement") WHERE id=1
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: DBI quoting when I don't want it to
by Tardis (Pilgrim) on Aug 22, 2002 at 01:56 UTC |