SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Apr 2006
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Access to a db in other domain

    I have 2 domains in my server. Each of domains have 1 mysql db:
    mysite1.com --> db1
    mysite2.com --> db2

    How can I connect to db2 from mysite1.com in php?
    below code dose not work:
    $conn = mysql_connect('localhost','user_of_db2','password');

  2. #2
    SitePoint Enthusiast
    Join Date
    May 2003
    Location
    Nova Scotia, Canada
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What is the error message you receive?

  3. #3
    SitePoint Member
    Join Date
    Apr 2006
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My issue was solved:

    $conn = mysql_connect('IP ADDRESS','user_of_db2','password');


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •