MistakenSanity Posted May 23, 2008 Share Posted May 23, 2008 I use 2 php scripts, one is a chat and the other is a forum. each requires its own database which you must create a user for both. Is there a way i can set it up so i can have 1 login that is automatically created for both tables? Quote Link to comment https://forums.phpfreaks.com/topic/106933-user-help/ Share on other sites More sharing options...
derzok Posted May 23, 2008 Share Posted May 23, 2008 Yes, but it's a bit annoying to do. You'd have to look at both of the applications' SQL databases and see what the differences/similarities between their structure is. Most user tables have columns for username, email, and all that jazz - you should mostly be concerned with any user_id column. You will either have to change one of the user tables to match the other (in terms of column names) OR make a reference table that has each users ID's in the same row. If you take the first option, you'll have to change the application that uses the changed database as well - make it point to the new tables and columns. You would also have to update any references to the ID's in the other tables that are on the same database as the changed table... If you choose to make a reference table, you're up a similar creek because you must now edit all of the login/logout queries in your applications. In short, it's a lot of work and I only really suggest it if you don't have a lot of experience with PHP and SQL. A lot of forums have built in (or modular) chat applets so that you don't have to worry about crossing databases like this. If you do do it, back up your databases first - you might even consider testing it on empty tables first. Quote Link to comment https://forums.phpfreaks.com/topic/106933-user-help/#findComment-548057 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.