Reputation: 7487
Hello I have a very simple 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');
Upvotes: 0
Views: 175
Reputation: 3250
$this->Model->find('all', array('fields' => array('field_name')));
You can find more on retrieving your data in the Cookbook.
Upvotes: 1