Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re: Updating a mysql row

by imp (Priest)
on Feb 22, 2007 at 21:34 UTC ( #601649=note: print w/ replies, xml ) Need Help??

in reply to Updating a mysql row

Yes, do it exactly as you suggested... except you really should use bound parameters to avoid SQL injection attacks. Alternately you can use DBI's quote method

Something like this:

my $sql = q{UPDATE now_time SET time= NOW(), location=?, count=count+1 + WHERE ip=?}; $dbh->do($sql,{}, $ENV{HTTP_REFERER}, $userip) or die $dbh->errstr;

Comment on Re: Updating a mysql row
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (15)
As of 2015-07-29 13:07 GMT
Find Nodes?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...

    Results (263 votes), past polls