On May 19, 8:13 am, cake_cooker <[EMAIL PROTECTED]> wrote: > My query joins columns from mainly 2 tables and adds some more tables > 'booked' , 'available', etc... computing the previous columns. > So in my View i get the results like grouped according on the table > the come from (ex 'products', 'products_wedding_wishlist', etc.). But > the computed columns do not have a table so they are grouped under > '#sql_968_0'. Can you help me to try to give a defined name like > 'computed' or something else? So I can use it in the view more > efficiently
This is a known problem and has yet to be addressed in the Cake core. (it's been difficult for them to diagnose as a solid test case is required to duplicate the problem.) The problem occurs because mysql assigns a temporary table name (#sql_968_0 in this case) to the fields due to the complexity of your query. In the meantime, one solution I came up with was to declare a constant in the config and then use that to pull out those fields. I did this because once you move this code to production, that temporary table name will be different. It seems to be consistent every call be different per server. Hope that helps. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
