I’m having issue with find(‘list’) which is not returning rows on a specific values. But, when I’m executing the same query in SQLYog GUI it is actually returning rows.
Screenshot of cakePHP Debug kit SQL Log Query:
Screenshot of records when I execute this query in SQLYog GUI:
See below code which I’m using in a controller:
$proposal_part_length = number_format($filterForm[‘proposal_part_length’], 4, ‘.’, ‘’);
$proposal_part_width = number_format($filterForm[‘proposal_part_width’], 4, ‘.’, ‘’);
$this->loadModel('ProposalParts');
$parts = array();
$parts = $this->ProposalParts
->find('list', [
'keyField' => 'id',
'valueField' => 'proposal_id'
])
->where(['ProposalParts.length' => $proposal_part_length, 'ProposalParts.width' => $proposal_part_width])
->distinct(['ProposalParts.proposal_id'])
->toArray();
Both fields in where clause datatypes are “float(11,4)”. I’ve tried removing “number_format” function but still no records found with that QUERY but system is showing up records, if I change “length” and “width” values, like: “5”, “1” or “5.0000”, “1.0000”.
Does anyone have suggestion what’s wrong with this?
If you’ve any questions let me know.