You can get the next value like so:

$orderArray = $this->find(null, 'MAX(order) as order', null, -1);
$max = $orderArray[0]['order'];

You could put that in your model beforeSave method (or in the
controller if you preferred), to update the data to be saved. As it
doesn´t depend on user input, I think that using ajax to set this
value is complicating things  and potentially inviting problems.

HTH,

AD7six


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

Reply via email to