Posting/reading to/from multiple tables using a single form
Posted: Mon Sep 07, 2009 5:54 am
Hi, a newbie to the forum and PHP coding.
I have two applications on one site that use PHP and MySql, one a bulletinboard and one a gallery. Both have separate login pages and registration forms. I am looking to use a single, more comprehensive registration form and a single login for both applications. So visitors only have to register and/or login on the site once.
I have imported the tables from the one database in to the other so I now have a single database with multiple registration tables.
Unfortunately the tables have different names:
Table1 (Members)
password
*no entry*
email
added
status
displayname
Table2 (users)
user_password
user_nicename
user_email
user_registered
user_status
user_displayname
Would I be better off using the 'JOIN' (or similar) statement to link the tables or would the easier approach be to use PHP? within the form to post a single entry to the relevant fields in the two tables? I have also heard of something called 'switch'.
I am looking for any advice that would point me in the right direction as to the best method
Many thanks for your help in advance.
Gavin
I have two applications on one site that use PHP and MySql, one a bulletinboard and one a gallery. Both have separate login pages and registration forms. I am looking to use a single, more comprehensive registration form and a single login for both applications. So visitors only have to register and/or login on the site once.
I have imported the tables from the one database in to the other so I now have a single database with multiple registration tables.
Unfortunately the tables have different names:
Table1 (Members)
password
*no entry*
added
status
displayname
Table2 (users)
user_password
user_nicename
user_email
user_registered
user_status
user_displayname
Would I be better off using the 'JOIN' (or similar) statement to link the tables or would the easier approach be to use PHP? within the form to post a single entry to the relevant fields in the two tables? I have also heard of something called 'switch'.
I am looking for any advice that would point me in the right direction as to the best method
Many thanks for your help in advance.
Gavin