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

MySQL syntax error for ON DUPLICATE KEY UPDATE

by bradcathey (Prior)
on Jul 19, 2008 at 23:35 UTC ( #698862=perlquestion: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $stmt = 'INSERT INTO contact_form (' . join(',', keys %sql) . ') VA
    +LUES (' . join(',', ('?') x keys %sql) . ') ON DUPLICATE KEY UPDATE '
    +. join(' = ?, ', keys %sql) . ' = ?';
    
  2. or download this
    $VAR1 = 'INSERT INTO contact_form (more_info,city,name,address,comment
    +s) VALUES (?,?,?,?,?) ON DUPLICATE KEY UPDATE more_info = ?, city = ?
    +, name = ?, address = ?, comments = ?';
    
  3. or download this
    ...for the right syntax to use near ' city = , name = , address = , co
    +mments ='
    
  4. or download this
    ON DUPLICATE KEY UPDATE '
    +. join(' = ?, ', keys %sql) . ' = ?'
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://698862]
Approved by pc88mxer
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2014-08-30 18:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (293 votes), past polls