Your SQL didn't work , but I changed it a bit and this gives the same
output on both machines:

'SELECT `Chassis`.`equipment_id` FROM (select
`Chassis`.`equipment_id` from chassis as `Chassis` group by
`Chassis`.`equipment_id` LIMIT 3) as Chassis'

Note that the alias on the table in subquery is the same as the alias
for the whole subquery...

It looks like SQL soup..but it solves the problem...

Otherwise if aliases are different, I get different names for output
array keys

On Mar 21, 4:14 am, "wralph" <[EMAIL PROTECTED]> wrote:
> I always make it a habit of explicitly stating the alias in all my
> queries like so:
>
> SELECT `Chassis`.`a.equipment_id` FROM (select
> `Chassis`.`equipment_id` from chassis as `Chassis` group by
> `Chassis`.`equipment_id` LIMIT 3);
>
> Which should give you an array like no matter which mysql/PHP version
> you use:
> Array
> (
>     [0] => Array
>         (
>             [Chassis] => Array
>                 (
>                     [equipment_id] => 1
>                 )
>
>         )
> )
>
> Winston


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