Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
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: (6)
As of 2015-01-31 13:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My top resolution in 2015 is:

















    Results (258 votes), past polls