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
You should try like this:
public function record_exists(){ $exists = $this->db->get_where('table_name', array('id' => $id)); if($exists->num_rows() > 0 ){ echo "Some message"; return false; }else{ // Insert your data into the database... } }