I’m wondering if CakePHP 1.3 has a convention for how you should find the last row added, so that you can redirect to a view of that record.
At the minute the user would create a new bill by going to “/bills/add” and filling in the form. On completion I’d like to send them to “/bills/view/[id of the row they just added]”
I know I can do this using “mysql_insert_id()” but I’d like to think CakePHP has a neater way of doing it.
After saving the new record, you can redirect with:
After calling save, ->id is populated with the new insert id.
Manual