Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^4: error ..ON DUPLICATE KEY UPDATE value='''

by runrig (Abbot)
on Aug 02, 2013 at 23:18 UTC ( [id://1047669]=note: print w/replies, xml ) Need Help??


in reply to Re^3: error ..ON DUPLICATE KEY UPDATE value='''
in thread error ..ON DUPLICATE KEY UPDATE value='''

What values should be inserted? If a blank feature_id is valid, supply a NULL (no quotes). If it is not valid, then skip that record.
  • Comment on Re^4: error ..ON DUPLICATE KEY UPDATE value='''

Replies are listed 'Best First'.
Re^5: error ..ON DUPLICATE KEY UPDATE value='''
by nafri (Initiate) on Aug 03, 2013 at 13:35 UTC
    thanks all of you.. i finally sorted it out.. i changed the function to this and it works
    if($prodid && $cat_featureid && $value){ my $sql = "INSERT INTO products_features (product_id, feature_id, +value) VALUES (".$prodid.", ".$cat_featureid.", ".$dbh->quote($value) +.") ON DUPLICATE KEY UPDATE value=".$dbh->quote($value); $dbh->do($sql); }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1047669]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (6)
As of 2024-04-16 07:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found