0

My CodeIgniter project runs well on localhost but when I uploaded it on live server produce some errors like this:

ERROR: "unexpected T_CONSTANT_ENCAPSED_STRING"

in this part of code:

$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
                ));
halfer
  • 19,824
  • 17
  • 99
  • 186
  • 1
    the array element must be separated by a comma 'username' => $username, 'email' => $email , and so on – ScaisEdge Nov 03 '16 at 20:02

1 Answers1

2

Should be like this:

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

You need to pass array with all the values but you were using wrong syntax for that.

Just_Do_It
  • 821
  • 7
  • 20