This is in Spanish, but the code is fairly understandable:

http://cakephpilia.blogspot.com/2008/01/buscando-en-relaciones-habtm.html

On Fri, Mar 7, 2008 at 5:36 AM, Hiro <[EMAIL PROTECTED]> wrote:
>
>
>  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,
>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to