Cake has no explicit support for database views, although they usually
work fine for reads.  However, one gotcha is that, when setting up
your views, you have to alias all the columns, otherwise MySQL will
report the original table names that the results are from, and the
field arrays will be split in funny ways.


On Apr 24, 1:49 pm, Sebastian Veggiani <[EMAIL PROTECTED]> wrote:
> Hi,
>
> somebody could clarify what is the level of support of Cake 1.2 for
> woriking with MySQL Views?
>
> For example, I've a chain o associations of three or more levels.
>
> If I want to filter the results by a field in the 3rd level or beyond
> there is no easy way to do it, unless I use a Custom SQL Query, but in
> this case I can't use the Model paginator in the view.
>
> The solution I found was to create a View in MySQL with the necessary
> data from joined tables and then filter by one of these fields. This
> works OK for me.
>
> The problem comes with pagination  and sorting. When I try to sort by
> a view field which is not in the main table (specified by FROM) the
> application fails. Ordering by any field in the main table works OK.
>
> anybody knows something about MySQL Views in cake?
>
> Thanks,
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to