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 ( #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 pondering the Monastery: (5)
As of 2015-07-05 02:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls