php - Codeigniter on duplicate key update with auto increment in MySQL -


how insert on duplicate key update in mysql primary key auto increment number ? unique key cannot specified new record..

odku works not primary keys, works on unique keys. u should define 1 unique key catch duplicates.

    alter table `table` add unique (     `field1` /*     ...     ,`fieldn` */     ); 

Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -