Hi, new to CakePHP and wondering if anyone has any insight on this one. Background: this is an online testing application. There are 3 role types that will have different information and access levels. As such, I have:
- A user table (ensures a unified namespace and allows us to check one table at login). This stores just an id, password and a role type id (foreign key to user_types)- all fields pertinent to all roles. - One table each for the roles- student, instructor and administrator to hold role-specific data. What I want to do: insert a record into the user table, then create a record in the role table which stores the id of the just-created user as a foreign key. Here is how I imagine creating a new administrator: - I have a button on the UI "Create New User". This would insert a new record into users. There is no user entry here- the password is randomly generated, the user_type_id would be determined automatically since we know what type of user we are creating, and id is autonum. - The add function of users controller would then redirect the user after the form is submitted to view /administrators/add - The /administrators/add view would have a form to add details about the new administrator such as phone, etc. The real question: how to pass the id of the newly created user record so it can be inserted into the administrator table along with the data entered when the administrator form is filled out?? Thanks in advance! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" 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 -~----------~----~----~----~------~----~------~--~---
