Welcome Guest, Not a member yet? Register   Sign In
Parse error: syntax error, unexpected T_DOUBLE_ARROW
#1

[eluser]anna16[/eluser]
Hi guys

I'm trying to insert an ip address inside an array below is the codes,

Code:
function create_member()
    {
        $ip = $_SERVER['REMOTE_ADDR'];
        
        $new_member_insert_data = array(
            'first_name' => $this->input->post('first_name'),
            'last_name' => $this->input->post('last_name'),
            'email_address' => $this->input->post('email_address'),            
            'username' => $this->input->post('username'),
            'password' => md5($this->input->post('password'),
            'ip_address' => $ip
        );
        
        $insert = $this->db->insert('membership', $new_member_insert_data);
        return $insert;
    }

and this is the error below,
Code:
Parse error: syntax error, unexpected T_DOUBLE_ARROW

I believed the ip_address insert is wrong, but I'm confused where the error was?

thanks in advance.
#2

[eluser]tomcode[/eluser]
You're missing a closing bracket :

Code:
//..
'password' => md5($this->input->post('password')),
// ..




Theme © iAndrew 2016 - Forum software by © MyBB