MySQL Forums
Forum List  »  PHP

Re: comparing data in a table to user data
Posted by: deliverance1957
Date: April 05, 2006 02:59PM

hmm I tried to use the ON DUPLICATE KEY UPDATE

in the table pending web is the primary, web and email are both unique.

----------------------------------------
$sql = "INSERT INTO `pending` (name, lan, web, last_name,email)
VALUES ('$name', '$hostname', '$web', '$lastname', '$email')
ON DUPLICATE KEY UPDATE name='$name', web='$web', email='$email' ";

You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'ON DUPLICATE KEY UPDATE name='test', web='www.test.com', ema
----------------------------------------

ON DUPLICATE KEY UPDATE doesn't look wrong to me and the values are not empty. I am using version 3.42 but it all looks good, any tips?



Edited 2 time(s). Last edit at 04/05/2006 02:59PM by deliverance1957.

Options: ReplyQuote


Subject
Written By
Posted
Re: comparing data in a table to user data
April 05, 2006 02:59PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.