i m working classifieds controller
this is code
public function create_add(){
if(!empty($this->data))
{
if($this->Classified->save($this->data)){
$this->User->save(array('id'=>$this->Auth->User('id'),'pending_attempts'=>$this->Auth->User('pending_attempts')-1));
$data = $this->User->read();
$this->Auth->login($data);
}
}
}
i want to updating the ‘pending_attempts’ column in user table , for example:
pending_attempts = 10;
Every time run this code, pending_attempts will be 10 – 1, and always resulting in 9.
After login only time code work and update the database , if i again run that code create_add() it always show pending_attempts =9
Problem is that how to refresh Auth data ?
I got the solution of my question , that code working fine for me