Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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 scrutinizing the Monastery: (6)
As of 2014-09-18 10:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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











    Results (111 votes), past polls