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

Reply via email to