2016-11-03 3 views
0

내 CodeIgniter의 프로젝트는 로컬 호스트에서 잘 실행하지만 라이브 서버에 업로드 할 때 약간의이 같은 오류 발생 :오류 : "예상치 못한 T_CONSTANT_ENCAPSED_STRING는"

$username = $this->input->post('username'); 
      $email = $this->input->post('email'); 
      $password = $this->input->post('password');      $flag = 0; 

      $data = $this->user_model->Signup_user((
       'username' => $username 
       'email' => $email 
       'password' => $password 
       'flag' => $flag 
       )); 
+1

배열 요소는 쉼표 'username'=> $ username, 'email'=> $ email 등으로 구분해야합니다. – scaisEdge

답변

2

: 코드의이 부분에

ERROR: "unexpected T_CONSTANT_ENCAPSED_STRING"

을 다음과 같아야합니다 :

$username = $this->input->post('username'); 
$email = $this->input->post('email'); 
$password = $this->input->post('password');       
$flag = 0; 

$data = $this->user_model->Signup_user(
    array(
    'username' => $username, 
    'email' => $email, 
    'password' => $password, 
    'flag' => $flag, 
    ) 
); 

당신은 모든 값을 가진 배열을 전달해야하지만, 그것에 대한 잘못된 구문이 있습니다.

+3

왜 작동하지 않는지 설명해야 OP가 무엇을했는지 이해할 수 있습니다 잘못된. –

+0

죄송합니다. 설명이 추가되었습니다. 감사. –

+0

문제가 없으므로 OP가 자신의 실수에서 더 쉽게 배우도록하십시오. –

관련 문제