View Full Version : shared database
cruiseagent
06-09-2008, 03:49 PM
I am not a real tech person so I really could use some help in reference to databases.
I have two different web sites. One is php and the other is asp.net. Not real smart I know have two different formats. Did not know any better at the time.
So my question is I want to be able to have the databases talk to each other so the members will only have to log in once and have only one membership.
One database is mssql and the other is mysql is this possible? If so please explain so I can see about doing or hiring someone.
Tech Manager
06-09-2008, 04:50 PM
Yes this is possible. You could set up the user validation within one website and have it act as the clearing house for user data. There really is no need to have both databases talk to eash other unless you plan to keep separate user data.
A simple connection to the database holding the credentials will take care of the matter. Assuming the databases are on the same server it is a piece of cake. If they reside on different servers it will work almost as easily. Just make sure the chosen database can handle remote connections.
kronikmedia
06-09-2008, 10:40 PM
Another alternative could be to write a bridge script of some sort that will automatically keep both websites in synch. You can also write a export script that will transfer data from one to the other and set this up as a cronjob,
There may already be a database connection class ready for you:
Class: Database Connection Classes (database, connection, database class, mysql connection) - PHP Classes (http://www.phpclasses.org/browse/package/3396.html)
Relevant article:
The PHP Anthology Volume 1, Chapter 2 - Object Oriented PHP [PHP & MySQL Tutorials] (http://www.sitepoint.com/article/object-oriented-php)
more precisely page 10.
The PHP Anthology Volume 1, Chapter 2 - Object Oriented PHP [PHP & MySQL Tutorials] (http://www.sitepoint.com/article/object-oriented-php/10)
cruiseagent
06-10-2008, 12:20 PM
Thank you for all of the help. I might not of explained real well.
Here is what I am thinking about.
I have two web sites with two different databases of membership. One is php and the other is asp.net.
Here are my thoughts since both sites attract the same clients I wanted to make different memberships available. One would be to site 1 and the other would be to site 2 with a third option of a combo membership to site 1 and 2.
This would be for existing and new members.
All of this to be managed from just one admin area with one payment area and of course just one sign in to access the areas they are approved to access depending on the membership program each has.
I hope that this makes things a little clearer. Am I looking at a major project and major expense? I hope that this is all workable and not to expensive. Would it be easier to re write the asp.net product to php? I am just at a loss in what direction to go.
advancedmerchant
06-15-2008, 12:43 PM
You could do it by having a single database, and adding 2 fields- "SITE 1" and "SITE 2" When someone signs up at site #1, you build the record, and set "SITE 1" to true. Same for Site 2. If someone from one site wants to register at the other, they can enter their login, but get a message asking if they want to be registered under the same name at this site as well. Once paid, you would set the flag for the second site. You would just have to add logic to check for the proper flag at login time to both sites, but you would have a single, integrated database.
sryk3
06-17-2008, 08:15 AM
I think this will work. did u try it? please tell us what happened because i want to use this also
cruiseagent
06-17-2008, 08:45 AM
We have not tried as yet. We are looking for someone to do this. We have a bid request out with a few different areas, rentacoder and elance to see what the cost would be. Will let you know
angeldemon
12-04-2008, 11:59 PM
i prefer having the login info located in one db (mysql) and the rest on the other db (mssql) and then have the application use both db.
marms676
12-23-2008, 04:33 PM
I am interested in seeing how this shakes out. I have a similar senerio where I have a MySQL CRM and an accounting system on MS SQL Server that need to communicate
Jenniferlinn
03-17-2009, 04:40 AM
I don't think it is possible as both of your databases are different and if by chance it is possible then there will be lot of in-depth knowledge required for both databases
Those options seem to be some good advice you should use. Have you sorted out the migration of both database and how you will deal with the different formats? Maybe exporting them and then uploading them together in the same table.
full house
08-06-2009, 11:35 AM
I've tried that and it work, you can do it just don't be scared in trying.