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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ujwalarali85
    New Member
    • Sep 2009
    • 13

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

    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
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    Originally posted by ujwalarali85
    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?

    Comment

    • TheServant
      Recognized Expert Top Contributor
      • Feb 2008
      • 1168

      #3
      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.

      Comment

      • ujwalarali85
        New Member
        • Sep 2009
        • 13

        #4
        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.

        Comment

        • TheServant
          Recognized Expert Top Contributor
          • Feb 2008
          • 1168

          #5
          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.

          Comment

          • prabirchoudhury
            New Member
            • May 2009
            • 162

            #6
            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

            :)

            Comment

            Working...