Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

MySQL syntax error for ON DUPLICATE KEY UPDATE

by bradcathey (Prior)
on Jul 19, 2008 at 23:35 UTC ( [id://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
Domain Nodelet?
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?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2024-04-24 10:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found