If i remember correctly, i have tested this function a month ago and its working. Now its not.
This is the model :
function delete($table, $id) {
$query = $this->db->delete($table, array('id'=>$id));
//return $this->db->affected_rows();
return $query;
}
And i use it on my controller :
$schedule_id = $this->post('id');
$result = $this->schedule_m->delete('schedule', $schedule_id);
if($result == true )
{
$this->response(array('result' => 'true'), 200);
}
The response is always true, but the row is never deleted.
I tried to return $this->db->affected_rows(); and use var_dump, the result is int(0).
Please kindly help me. Thanks for your time.