INSERT or UPDATE ON DUPLICATE

Object Oriented Style Insert Or Update If Already Present (Update if primary keys are not unique) Insert Or Update If Already Present WHERE You can ‘t use WHERE with ON DUPLICATE KEY UPDATE. A typical solution is to use a double operation instead, INSERT IGNORE followed by and UPDATE WHERE Insert or Do Nothing If […]

Read More

.INSERT General

Object Oriented Style Get Auto ID Of New Record Procedural Style Get Auto ID Of New Record The mysqli_insert_id() function returns the ID generated by a query on a table with a column having the AUTO_INCREMENT attribute. If the last query wasn’t an INSERT or UPDATE statement or if the modified table does not have a […]

Read More