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# - ajax - How to receive data both html and json from server? -

c# - SharpDX Toolkit models rendering inside out -