I am trying to retrieve one column per record by way of the find(). When I execute my code It returns all the fields in the table. Here is my code. What is wrong with my code? I am using Cakephp 1.3.
public function findPolicyIds($coverageId = null) {
$id = $this->Policy->find('all', array(
'recursive' => -1, array(
'fields' => array('Policy.id'))));
return $id;
}
I think you have a extra array being formed. Try this:
public function findPolicyIds($coverageId = null) {
$id = $this->Policy->find('all', array(
'recursive' => -1,
'fields' => array('Policy.id')));
return $id;
}
Code untested.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With