Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
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 musing on the Monastery: (5)
As of 2014-12-21 01:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (100 votes), past polls