Welcome Guest, Not a member yet? Register   Sign In
Unexpected character in input: ''' (ASCII=39) state=1
#1

[eluser]Loquela[/eluser]
Hi there,

I have a registration utility with the following method:

Code:
function create_user(
    {
18        $insert_new_user = array(
19        'user_firstname'      => $this->input->post('user_firstname'),
20        'user_lastname'     => $this->input->post('user_lastname'),
21        'user_username'        => $this->input->post('user_username'),
22        'user_email'        => $this->input->post('user_email'),
23        'user_password'        => $this->input->post('user_password')
24        );
25        
26        $insert = $this->db->insert('360_user',$insert_new_user');
        return $insert;
    }

This works perfectluy fine and the data is inserted with the data as expected. However, I am getting thefollowing error after the insert:

Code:
Warning: Unexpected character in input: ''' (ASCII=39) state=1 in C:\xampp\htdocs\loquela_360\application\models\user_model.php on line 26

I'm using codeigniter 1.7.2 on Xampp.
Thanks in advance for any help.

L.
#2

[eluser]eoinmcg[/eluser]
Code:
$insert = $this->db->insert('360_user',$insert_new_user');

remove the stray ' after $insert_new_user. so it reads

Code:
$insert = $this->db->insert('360_user',$insert_new_user);
#3

[eluser]Loquela[/eluser]
Doh!

I need some rest.

Thanks.




Theme © iAndrew 2016 - Forum software by © MyBB