Seems that you are replacing the name and not the value. I do not know
much in details the REPLACE of mysql, but I wounder what you are
trying to do. If you want to query a field and replace it, maybe do
not query the field and set it to the value you want .. ?
On Jul 11, 4:17 am, laptop <[EMAIL PROTECTED]> wrote:
> Hi,
>
> How can I use a mysql function and have the result be in the same
> format with the Model name being keys in the associative array. ie.
>
> $this->WorkoutSet->findAll(NULL, 'WorkoutSet.id, WorkoutSet.weight');
>
> will result in
>
> array('WorkoutSet' => array('id' => 45, 'weight' => 45.53')
>
> BUT
>
> If I have $this->Workout->WorkoutSet->findAll(NULL, 'WorkoutSet.id,
> REPLACE(WorkoutSet.weight, '.00', ''));
>
> results in
>
> array('WorkoutSet' => array('id' => 45), 0 => 'weight' => 45.53);
>
> -----
>
> I have tried using MySQL aliases such as 'REPLACE(...) AS weight' and
> 'REPLACE(...) AS WorkoutSet.weight' but neither works.
>
> thanks
> craig
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---