If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > PHP > connecting to mysql form other location

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-02-04, 10:18
Lord_Saroman Lord_Saroman is offline
Registered User
 
Join Date: Aug 2004
Posts: 16
connecting to mysql form other location

normally I would use this code if I use my own apache server:

$dbh = mysql_connect ("localhost","root","password") or die ('I cannot connect to the database because: ' . mysql_error());

It workes just fine. But how could I connnect to mysql if the PHP script is located on another server?
The other server does have PHP functions.

I have tried stuff like:

$dbh = mysql_connect ("my ip adress","root","password") or die ('I cannot connect to the database because: ' . mysql_error());

and

$dbh = mysql_connect ("my ip adress/localhost","root","password") or die ('I cannot connect to the database because: ' . mysql_error());

I might be way OFF , thanks for the help guys.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On