remyremy remyremy - 1 year ago 158
MySQL Question

num_rows on delete query codeigniter

I'm trying to find a way to validate that my Delete query was successful. How can I get num_rows or affected_rows from the following structure:

public function fire_db($currentUserID, $id_staff){
$this->db->where('id_player', $currentUserID);
$this->db->where('id_hired_staff', $id_staff);
if ($this->db->num_rows() == 1) {
return true;
return false;

Using codeigniter 3

Answer Source

to test result of delete query use