Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

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

by runrig (Abbot)
on Aug 02, 2013 at 23:18 UTC ( #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='''
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
Node Status?
node history
Node Type: note [id://1047669]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (10)
As of 2014-11-01 00:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (226 votes), past polls