Query by field name in cakephp
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.
精彩评论