Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



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

Posts: 27
Trades: 0
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
 
 
Register now for full access!
Old 03-08-2008, 09:53 AM Re: how to share 1 database on two different site???
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
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.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 03-08-2008, 02:09 PM Re: how to share 1 database on two different site???
Ultra Talker

Posts: 310
Trades: 0
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.
dman_2007 is offline
Reply With Quote
View Public Profile
 
Old 03-08-2008, 04:02 PM Re: how to share 1 database on two different site???
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
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...
__________________
Only a biker knows why a dog sticks his head out the window.

Last edited by tripy; 03-08-2008 at 04:04 PM..
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 03-08-2008, 11:38 PM Re: how to share 1 database on two different site???
Ultra Talker

Posts: 310
Trades: 0
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.
dman_2007 is offline
Reply With Quote
View Public Profile
 
Old 03-09-2008, 12:23 AM Re: how to share 1 database on two different site???
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
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.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 03-09-2008, 05:08 AM Re: how to share 1 database on two different site???
ForrestCroce's Avatar
Half Man, Half Amazing

Posts: 3,023
Name: Forrest Croce
Location: Seattle, WA
Trades: 0
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.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
ForrestCroce is offline
Reply With Quote
View Public Profile Visit ForrestCroce's homepage!
 
Old 03-09-2008, 06:16 AM Re: how to share 1 database on two different site???
Ultra Talker

Posts: 310
Trades: 0
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).
dman_2007 is offline
Reply With Quote
View Public Profile
 
Old 03-16-2008, 09:07 AM Re: how to share 1 database on two different site???
Average Talker

Posts: 27
Trades: 0
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 Search this Thread
Search this Thread:

Advanced Search

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

BB 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.29188 seconds with 12 queries