473,382 Members | 1,225 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

How to constantly copy login data from one sql database to another?

Is there a PHP or some sort of script that will allow me to have logins created on one database also created on another?

My main database is using Drupal and the second is Simple Machines Forum. I need people who register for the Drupal side of the equation (the main domain) to have the same login info for the SM forum (the sub domain).

I've read other articles about how to transfer the login information from one database to another, but I need a constant creation of any new registrations to be on BOTH databases.

Thank you for any help with this.
Jan 27 '11 #1
2 2002
Markus
6,050 Expert 4TB
The simplest way to do this would be to run the sub-domain's query in the same script that runs the main signup code.

Expand|Select|Wrap|Line Numbers
  1. // Main domain
  2. $main_domain_conn = mysql_connect( 'domain.tld', 'user', 'pass' );
  3. mysql_query( $create_user_sql, $main_domain_conn );
  4. // Sub-domain
  5. $sub_domain_conn = mysql_connect( 'sub.domain.tld', 'user', 'pass' );
  6. mysql_query( $create_user_sql, $sub_domain_conn );
  7.  
Jan 27 '11 #2
Thank you Markus!

Now, since I'm no expert at this, where exactly would I put this code? On the database right? Or would it be on the server in one of the files?

Thanks so much!
Jan 27 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: harris | last post by:
I am needing some help with a few asp pages and a login script. Let me start by describing my project. I am trying to connect to a database and verify a users login and password, then based on...
2
by: Jim Andersen | last post by:
I want to take a copy of a database, and mail it to another sql-server, and then get it up and running. I normally detach it, and copy the .MDF. But there are users using the database, so that...
2
by: Blue Porcupine | last post by:
Hi, I need to copy a database for example I have ABC I want to create ABC_Test How to do that? regards,
2
by: Fabius | last post by:
Hello all. I need transfer a db2 database ( tables, records ecc. ) from a server1 to server2. The operating system of server1 and server2 is win2000 server. I have installed db2 to server2. Now...
3
by: Sandli Bygg AS, Kent Olsson | last post by:
Hi! How can I copy a Access-database and relations, but without data? Best regards Kent Olsson
12
by: alanchinese | last post by:
i am a db2 newbie. we have a server hosting a db2/6000 database that restricts the use of backup, generate ddl. i wonder if there is a simple way to transfer the database structure and data into my...
0
by: serge | last post by:
I have 2 SQL Enterprise Editions running SP2 and same collation. When i try to start database mirroring I get the following error message: "The remote copy of database "ABC" has not been...
5
by: Steve | last post by:
Hi; I thought I would rephrase a question I asked in another post to more quickly get to the heart of the matter. My apologies for anyone who is offended by what appears to be a repetition. ...
2
by: miroku800 | last post by:
A little history I designed a program in VB6 which used an access database with the aid of a then workmate (who has now moved on and lost interest) which was in two parts. A master program and a...
9
by: dpatel75 | last post by:
I am trying to copy a database from a SQL 2000 SP3 Windows 2000 server to a 2005 SP2 Windows 2003 server. I am trying to use detach and attach method (have tried both within Management Studio and...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.