<< Back
How do I retrieve one value from a database in cakephp?
How do I retrieve one value from a database in cakephp?
You can retrieve a single value in more than one way in cakephp
either like so:
$value = $this->model->field('fieldname', array('fieldid' ->$vlaue));
$logincount = $this->User->field('logincount', array('id' => $login_user['id']));
or like so:
$logincount = $this->User->find('first', array('conditions' => array('id' => $login_user['id'])));
Published: 1st June 2016 by