EllisLab text mark
Advanced Search
     
Active Record Update
Posted: 11 October 2012 02:37 AM   [ Ignore ]
Avatar
Joined: 2012-10-02
83 posts

Hello everyone!
I have this update code but returns error

$data = array('password'$new_password);
   
$this->db->where('email'$this->session->userdata('email'));
   
$update_query $this->db->update('users'$data); 

I am trying to update the password of the user

 
Posted: 11 October 2012 02:38 AM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2011-10-12
107 posts

Try this:

$data = array(
'password' => $new_password
); 

Btw. this is the wrong forum for this question wink

 
Posted: 11 October 2012 02:49 AM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Avatar
Joined: 2012-10-02
83 posts

Oops! my bad.
I don’t know but its working now. :|

 
Posted: 11 October 2012 03:06 AM   [ Ignore ]   [ # 3 ]   [ Rating: 0 ]
Avatar
Joined: 2011-10-12
107 posts
ninjayan - 11 October 2012 02:49 AM

Oops! my bad.
I don’t know but its working now. :|

What did u changed?

 
Posted: 11 October 2012 03:15 AM   [ Ignore ]   [ # 4 ]   [ Rating: 0 ]
Avatar
Joined: 2012-10-02
83 posts

Nothing?
username and email were present in session

//UPDATE THE PASSWORD
   
$data = array('password' => $new_password);
   
$this->db->where('username'$this->session->userdata('username'));
   
$update_query $this->db->update('users'$data); 
 
Posted: 11 October 2012 03:20 AM   [ Ignore ]   [ # 5 ]   [ Rating: 0 ]
Avatar
Joined: 2011-10-12
107 posts
ninjayan - 11 October 2012 03:15 AM

Nothing?
username and email were present in session

//UPDATE THE PASSWORD
   
$data = array('password' => $new_password);
   
$this->db->where('username'$this->session->userdata('username'));
   
$update_query $this->db->update('users'$data); 
//UPDATE THE PASSWORD
$data = array('password' => $new_password); 

wink