php - my code please help syntax error, unexpected '=>' (T_DOUBLE_ARROW) -


this question has answer here:

my code please have tried several times , error in

        $data =('nidn' => $this->input->post('nidn', true));                 $pswd=('pswd' => $this->input->post('pswd', true))   `       public function cek_login() {         $data =('nidn' => $this->input->post('nidn', true));                 $pswd=('pswd' => $this->input->post('pswd', true));         $this->load->model('level_user'); // load model_user         $hasil = $this->level_user->cek_user($data,$pswd);      ` 

if assigning variable array, should add text array before brackets:

$data = array('nidn' => $this->input->post('nidn', true)); 

or,

$data = ['nidn' => $this->input->post('nidn', true)]; 

Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -