Hello,
I have the following code :
$criteria = array('cod_produs'=>$tuple['ImportData']['cod_produs'],
'furnizor'=>$tuple['ImportData']['furnizor']
);
if ($this->SupplierPrice->hasAny($criteria)) {
$vechi = $this->SupplierPrice->find($criteria);
}
The code works well, except for the cases when the field 'cod_produs'
contains the character dash '-' (for example cod_produs = 'KL(S)-23MU' ) .
In this case the following error appears at the top of the page:
Query: SELECT COUNT(*) AS count FROM `supplier_prices` AS
`SupplierPrice` WHERE (`cod_produs` KL(S) '-23MU') AND (`furnizor` =
'ALINE')
Warning: SQL Error: 1064: You have an error in your SQL syntax; check
the manual that corresponds to your MySQL server version for the right
syntax to use near 'KL(S) '-23MU') AND (`furnizor` = 'ALINE')' at line
1 in
/home/am/sites/sigmanet/sigma_new_admin/cake/libs/model/datasources/dbo_source.php
on line 470
Normally, the generated query should have contained :
WHERE (`cod_produs` = 'KL(S)-23MU' )
instead of
WHERE (`cod_produs` KL(S) '-23MU')
Does anyone happen know why a dash inside the value of the search criteria
could cause this incorrect query to be generated ?
--
Adrian Maier
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---