错误:“意外T_CONSTANT_ENCAPSED_STRING”

时间:2016-11-03 19:53:58

标签: php codeigniter

我的CodeIgniter项目在localhost上运行良好,但是当我将它上传到实时服务器上时会产生一些错误:

  

错误:“意外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 个答案:

答案 0 :(得分:2)

应该是这样的:

$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,
    )
);

您需要传递包含所有值的数组,但是您使用了错误的语法。