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

renaming files in a directory using python or R -

html - outline-style different in chrome compared to firefox and internet explorer -

ruby on rails - Carrierwave Timeout -