Reply
how to share 1 database on two different site???
Old 03-08-2008, 05:15 AM how to share 1 database on two different site???
Average Talker

Posts: 27
i am working for
www.kalyancity.com and
www.jaheraat.com

these are two different web sites. hosted on two different server (linux).

but for these two different web site i want to make a single comman database....

so if user gets login to kalyancity.com then he should automatically login to jaheraat.com



making both web site on single server will help me?????
__________________
me people say that I must be a horrible person, but that's not true. I have the heart of a young boy -- in a jar on my desk.
abhifrds2005 is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 03-08-2008, 08:53 AM Re: how to share 1 database on two different site???
tripy's Avatar
Fetchez la vache!

Posts: 1,819
Name: Thierry
Location: In the void
no, simply give access to the database on the 2 servers (if mysql, you should use 2 different users, and specify from which hosts they can connect) and make your script connect to the server the db is rather than localhost.

it's nothing more than that.
But be warned that the web site will need to comunicate with the db server through internet, and that if the 2 have connections problems, it can cause problems.
Note too that the communication between the remote site and the database will use bandwidth on both of your accounts.
From one, it's on the ascending side, and on the descending side for the other.

Quote:
making both web site on single server will help me?????
It just remove the connectivity and bandwidth issues.
__________________
Listen to the ducky: "This is awesome!!!"

tripy is online now
Reply With Quote
View Public Profile
 
Old 03-08-2008, 01:09 PM Re: how to share 1 database on two different site???
Ultra Talker

Posts: 308
Well, you can surely use a common database for two websites. Even then a user logging onto kalyancity.com won't automatically be logged into jaheraat.com, the max you'll be able to offer by using a common database is that user won't have to register twice for using both of these sites.
__________________
tiny url
dman_2007 is offline
Reply With Quote
View Public Profile Visit dman_2007's homepage!
 
Old 03-08-2008, 03:02 PM Re: how to share 1 database on two different site???
tripy's Avatar
Fetchez la vache!

Posts: 1,819
Name: Thierry
Location: In the void
Quote:
Originally Posted by dman_2007 View Post
Well, you can surely use a common database for two websites. Even then a user logging onto kalyancity.com won't automatically be logged into jaheraat.com, the max you'll be able to offer by using a common database is that user won't have to register twice for using both of these sites.
Sure you can.
You simply must use a custom session handler that will use the DB as recipient, that will not be tied to the domain name or IP adresse.
http://www.melbournechapter.net/word...vers-with-php/
That's the way big sites who are replicated on several servers (but with 1 domain name) are handling it.
Code:
devp4:~$ host google.com
google.com has address 64.233.187.99
google.com has address 64.233.167.99
google.com has address 72.14.207.99
google.com mail is handled by 10 smtp1.google.com.
google.com mail is handled by 10 smtp2.google.com.
google.com mail is handled by 10 smtp3.google.com.
google.com mail is handled by 10 smtp4.google.com.
Been there, done that...
__________________
Listen to the ducky: "This is awesome!!!"


Last edited by tripy : 03-08-2008 at 03:04 PM.
tripy is online now
Reply With Quote
View Public Profile
 
Old 03-08-2008, 10:38 PM Re: how to share 1 database on two different site???
Ultra Talker

Posts: 308
Quote:
Originally Posted by tripy View Post
Sure you can.
You simply must use a custom session handler that will use the DB as recipient, that will not be tied to the domain name or IP adresse.
http://www.melbournechapter.net/word...vers-with-php/
That's the way big sites who are replicated on several servers (but with 1 domain name) are handling it.
Code:
devp4:~$ host google.com
google.com has address 64.233.187.99
google.com has address 64.233.167.99
google.com has address 72.14.207.99
google.com mail is handled by 10 smtp1.google.com.
google.com mail is handled by 10 smtp2.google.com.
google.com mail is handled by 10 smtp3.google.com.
google.com mail is handled by 10 smtp4.google.com.
Been there, done that...
I know about custom session handler and sharing session across multiple subdomains or sites, but the fact is unless the user uses a link (which includes session id) from one site to go to another site, session information can't be passed and this won't always be the case.
__________________
tiny url
dman_2007 is offline
Reply With Quote
View Public Profile Visit dman_2007's homepage!
 
Old 03-08-2008, 11:23 PM Re: how to share 1 database on two different site???
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,945
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
The question that I have is...if two sites are using the same database and login credentials/session/cookie info, why not just mirror the two domains and save yourself the trouble of configuring a multiple site database to begin with?

To see a similar (although not identical) concept, go to http://webmaster-talk.com (without the w w w...this is on purpose). You'll see that you get 301-redirected to www.webmaster-talk.com . This can easily be done with domains as well.
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 03-09-2008, 04:08 AM Re: how to share 1 database on two different site???
ForrestCroce's Avatar
Half Man, Half Amazing

Latest Blog Post:
Talapus Lake in June Snow
Posts: 3,022
Name: Forrest Croce
Location: Seattle, WA
Quote:
Originally Posted by dman_2007 View Post
I know about custom session handler and sharing session across multiple subdomains or sites, but the fact is unless the user uses a link (which includes session id) from one site to go to another site, session information can't be passed and this won't always be the case.
It's a lot harder to share an authenticated session across multiple domain names, but I think our friend only wants to let users share the same credentials ... even if they have to actually log in to both sites.
ForrestCroce is offline
Reply With Quote
View Public Profile Visit ForrestCroce's homepage!
 
Old 03-09-2008, 05:16 AM Re: how to share 1 database on two different site???
Ultra Talker

Posts: 308
Quote:
Originally Posted by ForrestCroce View Post
It's a lot harder to share an authenticated session across multiple domain names, but I think our friend only wants to let users share the same credentials ... even if they have to actually log in to both sites.
That's what i said in my first post (ability to have a common login details for both sites and not having to register twice).
__________________
tiny url
dman_2007 is offline
Reply With Quote
View Public Profile Visit dman_2007's homepage!
 
Old 03-16-2008, 08:07 AM Re: how to share 1 database on two different site???
Average Talker

Posts: 27
oki.... thanx guys.... i'll do practically then i'll let u know.... but lets hope this will help me....



thanx....
__________________
me people say that I must be a horrible person, but that's not true. I have the heart of a young boy -- in a jar on my desk.
abhifrds2005 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to how to share 1 database on two different site???
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.16138 seconds with 13 queries