lundi 3 octobre 2016

What kind of "IF" Statement in CodeIgniter?

What kind of IF statement to showing ALERT ..

 function actAdd(){
                $this->load->model("person_model"); 
                $query = $this->person_model->actPerson();
                if($query==TRUE){
                redirect('person/');    
                }else{
                echo "<script type='text/javascript'>alert('Failed !! Person is Exist.')</script>";
                echo "<script type='text/javascript'>window.location='".base_url()."person/'</script>";
                }

     }

If $query = $this->person_model->actPerson(); not INSERT data because record exist or anything else, i want to show the ALERT message.
So please help to find out right statement or syntax of Codeigniter query.
sorry for my bad english

Aucun commentaire:

Enregistrer un commentaire