Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: Re: DBI, SQL and Dates

by dws (Chancellor)
on Aug 07, 2002 at 08:36 UTC ( #188259=note: print w/replies, xml ) Need Help??

in reply to Re: DBI, SQL and Dates
in thread DBI, SQL and Dates

$dbhstmt->execute( "'$SuStCo_strID'", "'$date'" ); I suggest this, as it's a good idea to have quotes around anything going into SQL, to stop nasty input tricks.

Bad advice, unless you want to end up with extra quote characters around fields in the database. I've only seen people do that by accident.

Better to pass strings to execute() either unquoted, or surrounded by double quotes. The latter is needed if you're trying to "pass" on object that overides stringify, and you want to store the stringified representation.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://188259]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (9)
As of 2023-03-28 14:42 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (67 votes). Check out past polls.