Connecting Tech Pros Worldwide Help | Site Map

How to fetch records from other database and display and store at another site

Newbie
 
Join Date: Sep 2009
Posts: 13
#1: Sep 13 '09
Suppose There are two site A and B. User X on site A has account on Site B. So now I wan to show User X Details from site B to on Site A profile page. How I do this? Please give me your ideas.

Thanks you so much to giving attention to my query.
Markus's Avatar
Moderator
 
Join Date: Jun 2007
Location: York, England, with wolves.
Posts: 4,936
#2: Sep 13 '09

re: How to fetch records from other database and display and store at another site


Quote:

Originally Posted by ujwalarali85 View Post

Suppose There are two site A and B. User X on site A has account on Site B. So now I wan to show User X Details from site B to on Site A profile page. How I do this? Please give me your ideas.

Thanks you so much to giving attention to my query.

Do you have access to the records (the user data) on site B?
TheServant's Avatar
Expert
 
Join Date: Feb 2008
Location: Australia
Posts: 913
#3: Sep 14 '09

re: How to fetch records from other database and display and store at another site


I think we need a little more information, but am I right in guessing:
A user logs into site B (which he has an account on) then moves to site A (where you want him to be treated differently to someone without an account on site B)?
I am not sure what can be done with sessions, depending how you have your two sites set up, but site A could check user sessions (or cookies - argh) to see if he is a site B user, and then access the site B databse for some information. Just some ideas, but give a little more information if that doesn't help.
Newbie
 
Join Date: Sep 2009
Posts: 13
#4: Sep 15 '09

re: How to fetch records from other database and display and store at another site


I will try to explain little more.

Site A and Site B are two different site with their own database. Only connection is that when any user creates with basic info (username. password etc.) at Site A , then with same username user will created at site B. This is done part.

Now suppose user name with XYZ logged in at site A, I need to connect Site B and fetch record of User XYZ and show it at Site A profile page.

I hope its helps you to understand the problem.
TheServant's Avatar
Expert
 
Join Date: Feb 2008
Location: Australia
Posts: 913
#5: Sep 16 '09

re: How to fetch records from other database and display and store at another site


Are your two sites hosted together (can you access all your databases from either site)? As in: Can you not just connect to site B database, get the data, disconnect from site B database and the connect to site A database, continuing your work?

I must admit I have not done remote connections before if you do not have access from each site, but if that is the case, I am sure that someone can help you here.
prabirchoudhury's Avatar
Familiar Sight
 
Join Date: May 2009
Location: Wellington, New Zealand
Posts: 152
#6: Sep 16 '09

re: How to fetch records from other database and display and store at another site


ok

If those are in the different server
1. then you can allow external web servers to access your MySQL databases by adding their domain name to the list of hosts that are able to access databases on your web site. ypu have to do first Add Access Host (IP address) for both server. A's Ip tp server B and B's IP to server A. you could do this through cpanel access "Remort Mysql"


2. get the database details to access the database and make the sql connection.

3. you could get the XML feed from each server

if those in the same server

then you need the database details to make the connection and get data from other database.

If you dont have cpanel access then talk to the hosting people they could do for you

hope could help

:)
Reply

Tags
mysql, php