Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connecting to a db not on localhost, PHP and MYSQL 1

Status
Not open for further replies.

solex

Programmer
Feb 28, 2003
91
GB
Hi,

I want to connect to a db at a different address than the local host, how can i do this?
I have the log in details (username and pass etc includeing the address of the web site
Thanx in advance

solex (charles)
 
In addition to sleipnir's post, you must add a user in the MySQL DB, providing user & passwd AND the host from where the user will connect..

 
No offence sleipnir, but some people find the manual unhelpfull. So they come here for help. Just quoteing pages from the manual does not allways help.

The page shows the example of localhost, not of an address out side of it, and that was my q.

thanx

solex
 
$handler = mysql_connect ("your_db_server", "usr","password")

solex, the command is the same, just change the server, but take care.. you must have the user, pass and host of the web server...

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top