Welcome Guest, Not a member yet? Register   Sign In
You must use the "set" method to update an entry. (Again)
#2

(This post was last modified: 10-13-2020, 05:05 AM by InsiteFX.)

You need to use QueryBuilder.

PHP Code:
$data = [
    'username'         => $username,
    'first_name'       => $first_name,
    'last_name'        => $last_name,
    'email_address'    => $email_address,
    'password'         => $hash,            
    
'activation_token' => $token
];
    
$insert 
$this->builder->insert($data);

// or

$db      db_connect();
$builder $db->table('users');

$data = [
    'username'         => $username,
    'first_name'       => $first_name,
    'last_name'        => $last_name,
    'email_address'    => $email_address,
    'password'         => $hash,            
    
'activation_token' => $token
];
    
$insert 
$builder->insert($data); 

Take your pick both should work for you.

Set is only used on update.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Messages In This Thread
RE: You must use the "set" method to update an entry. (Again) - by InsiteFX - 10-13-2020, 05:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB