Wednesday, January 20, 2010

Re: fetch data from 2 tables through cake pattern

from wich controller are you fetching data?

users or details?

PS: i suggest you to follow cake's db conventions

On 19 Gen, 06:33, John <sign.gro...@gmail.com> wrote:
> Hello
> I have two tables that is users and details. i want to fetch data from
> these 2 . i am getting details.id through which i have the whole row.
> and in this row i have details.user_id and through this user_id i want
> the row from users table.
>
> SELECT d.*,u.email, u.fname, u.lname
> FROM details as d
> LEFT JOIN users as u
> ON d.user_id = u.id
> WHERE d.user_id = u.id
>
> this is the simple query i want to make it through cake pattern but
> find anything yet
>
> Thanks in advance

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate