Skillbooker
Login Register

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'])));

 



Posted on: 2016-06-01 Please login/register to leave comments