Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
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 perusing the Monastery: (5)
As of 2014-10-01 08:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (391 votes), past polls