删除时键'PRIMARY'的重复条目'0'(codeigniter)
问题描述:
I am trying to delete a row from the database and, it gives me an error in codeigniter...
Here is my code...
public function deletePersonDetailsSingle($id){
$this->db->where('id', $id);
$this->db->delete('personhistories');
}
can you please help?
I have written two extra tables to store data and created two triggers for those tables. Here, two extra tables id's were not auto increment
*Note: I have already made my id in "personhistories" auto increment and unique
答
I wrote two trigger for my database. I used two extra tables "persons_audit" and "personhistories_audit" to store deleted data from "persons" and "personhistories". In those audit tables, PRIMARY KEY's were not auto increment. That's the reason of this error.