To whom it may concern :
I have 3 tables
User hasMany UserAttribute,
User hasOne Address,
then I did,
$search_query = '`User`.`account_validated` = 1 AND `Address`.`state` =
"LA"';
findAll ($search_query);
it works find.
but if I do this,
$search_query = '`User`.`account_validated` = 1 AND `Address`.`state` = "LA"
AND (
(`UserAttribute`.`title` = "gender" AND `UserAttribute`.`value`
=
"Female")
AND
(`UserAttribute`.`title` = "blood type" AND
`UserAttribute`.`value` = "O")
)
';
findAll ($search_query);
it won't work,
I did some experiment...
the join of UserAttribute table is not in the search query but in another
search query,
but I have no idea how or where to alter the query.
Is there a way to workaround?
Thank for the help :)
Hiro,
--
View this message in context:
http://www.nabble.com/how-can-I-define-search-conditions-when-using-hasMany--tp15891063p15891063.html
Sent from the CakePHP mailing list archive at Nabble.com.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---