Connect from one to another

Discussion in 'MySQL' started by D-Fraz, Nov 15, 2009.

  1. #1
    I was wondering how to connect a database to an external website.

    I'm not new at all to MySQL, it's just I don't know how to do this yet.
    Does anyone have any idea how?

    Thanks! :)
     
    D-Fraz, Nov 15, 2009 IP
  2. mastermunj

    mastermunj Well-Known Member

    Messages:
    687
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    110
    #2
    try using IP address or website.. I have also not done it yet, but If i were to, i would use IP address as first thing.
     
    mastermunj, Nov 15, 2009 IP
  3. D-Fraz

    D-Fraz Peon

    Messages:
    234
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    What do you mean?
    A basic way is:
    mysql_connect("localhost","username","pass");
    mysql_select_db("DB");
    
    PHP:
    Thanks.
     
    D-Fraz, Nov 15, 2009 IP
  4. mastermunj

    mastermunj Well-Known Member

    Messages:
    687
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    110
    #4
    localhost is used when you are trying to connect to same website / same server.

    from website A to website B you should use IP of website B.
     
    mastermunj, Nov 15, 2009 IP
  5. D-Fraz

    D-Fraz Peon

    Messages:
    234
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Ok so like: mysql_connect("71.XXXXXXXX"); correct?
     
    D-Fraz, Nov 15, 2009 IP
  6. mastermunj

    mastermunj Well-Known Member

    Messages:
    687
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    110
    #6
    that is what i would try, no harm in trying :)

    meanwhile someone who has already done this can comment about exact way of achieving the same..
     
    mastermunj, Nov 15, 2009 IP
  7. dhaval300

    dhaval300 Peon

    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    yes u can do it...n u have to add username and pasword tooo....
     
    dhaval300, Nov 18, 2009 IP