Now that I have my (very large!) registration form, I need to be able to submit the data to multiple tables. Ive seen the code elsewhere on this forum to submit to an extra table - so I assume that will work with multiple tables as well? However I am considerig the following scenario. A key point is that I have two user types - dealers and customers, with some shared, and some unique fields.
PHP in relation to onsubmit code ?
example: I have a firstname and surname (in addition to name and username) field. I could add them to the jos_users, however I assume that I dont want to be adding them onto a core table.
If I do not add them to jos_users, then I need to add them to either jos_cse_dealers or jos_cse_customers based on the answer to one of the questions in the form. Is this as simple as an if statment in the on_submit code ? (would a variable set by a radio button be available to php in the onsubmit ?)
Linking customer/dealer records to the ID in jos_user table ?
Does the onsubmit code run after the autogenerated code has finished ? In other words will I be able to retrieve the ID for the new record to use it as the primary key in either my jos_cse_users or my jos_cse_dealers table ? I am going to need to link these together for profile pages etc later. However I dont want to have fields that are potentially editable (such as username) as the index, as if a record changes, then I could lose my link betwen tables!
I can see (I think!) how a post statement can insert a record, but how to insert the userid of the registered user - when this is the registration form being submitted!
Thanks as always,
/Miz