Have an account? Sign in
Login  Register  Facebook
duplicate content
Hello Jooria !
please i want to update a table sql which content an ID + colum already exist
the probleme is when i want to make the insert it gave me a message error :
#1062 - Duplicate entry '35' for key 1 
so , i've try to make an UPDATE but it doesn't work too , cuz the syntax isn't correct the form of my requet sql is :
INSERT INTO `liens_series` (`id`, `id_series`, `password`) VALUES (35, '12', '<br>Saison 3 en cours de production'), .... 

the liste is too long
please help me !
thank you
Started: September 22, 2011 Latest Activity: September 22, 2011 sqlduplicate
1 Answer
If you insert a new row of which the id isn\'t determined yet:
INSERT INTO `liens_series` (`id`, `id_series`, `password`) VALUES (NULL, \'12\', \'<br>Saison 3 en cours de production\');
or
INSERT INTO `liens_series` (`id_series`, `password`) VALUES (\'12\', \'<br>Saison 3 en cours de production\');
The new id will be returned in LAST_INSERT_ID() (MySQL) or mysql_insert_id() (C, PHP etc.).

Use this It will do what you want, insert or update if neccessary.

Posted: MacOS
In: September 22, 2011

Your Answer

xDo you want to answer this question? Please login or create an account to post your answer