i am trying to check if an id in the database already exists and if it does not then only insert that id and not the other ones that exist
I have tried to do a where sta
$ql = $this->db->select('id')->from('testing')->where('id',$id)->get(); if( $ql->num_rows() > 0 ) {} else { $a = array('id' => $id, 'message' => $message); $this->db->insert('testing', $a); }
This should do it.