[eluser]Craig N[/eluser]
This is driving me slightly nuts - I wrote a simple delete function in my model that for some odd reason isn't working. It's below:
Code:
function delete_entry($id){
$this->db->where('id',$id);
$this->db->delete('candidates');
return ($this->db->affected_rows() > 0) ? TRUE : FALSE;
}
I've also tried $this->db->delete('candidates',array('id'=>$id)) and $this->db->query("DELETE * FROM candidates WHERE id='$id'"). Neither of those work either. Adding data and updating data using the same model and db table works fine, so I know it's connecting to the db. I've also echo'd out the id of the item to be deleted to make sure that's passing correctly (it is).
It's gotta be something simple, and I'm thinking that being able to actually see the queries that AR is producing would help figure it out. Any help is appreciated