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 1so , 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
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 1 of 1 people found this answer helpful. Did you? Yes No |
© Advanced Web Core. All rights reserved