Hi together,
since some hours I try to got a "SELECT IN" in a WHERE clause.
I read the example from http://book.cakephp.org/view/74/Complex-Find-Conditions
(nearly at the end).
I want to search with a array of zip codes. If I write in my
condition:
$conditions = array('OR' => array('Immobilien.zip' => array('49477',
'49808')));
everything works fine - Cake makes a select-statement like this one:
... WHERE `Immobilien`.`plz` IN
But I don't want to write my zip codes static. I got them dynamicly
from the database. The result is an array which I implode:
$svZipCodes = implode("', '",$saZipCodes);
$svZipCodes = " '" . $svZipCodes . "' ";
The result is exact the same, as I write "per Hand".
But if I use this one like
$conditions = array('OR' => array('Immobilien.zip' => array
($svZipCodes)));
Cake makes this
... WHERE `Immobilien`.`plz` = ('
\'49477\', \'49599\',
\'49549\') AND ...
You will note the "=" instead "IN"
It isn't an error in my string - if I copy the string from the browser
an use it as static in the condition, everything works fine.
Why make Cake this differences and what can I do?
Regards Thomas
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" 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
-~----------~----~----~----~------~----~------~--~---