开发者

Query by field name in cakephp

开发者 https://www.devze.com 2023-01-24 01:49 出处:网络
Hello I have a very simpl开发者_开发技巧e question, how do we query by field name?? I am using the regular query method, but I want to learn how it is done by one of the cakePHP methods, which would l

Hello I have a very simpl开发者_开发技巧e question, how do we query by field name?? I am using the regular query method, but I want to learn how it is done by one of the cakePHP methods, which would look like $this->Model->find('/*something like a query*/').

I am presently using the query method like $this->Model->query('select field_name from table_name');


$this->Model->find('all', array('fields' => array('field_name')));

You can find more on retrieving your data in the Cookbook.

0

精彩评论

暂无评论...
验证码 换一张
取 消