Connecting to SQL database in a different directory/server to website Scenario.... PHP pages are on one server, in a directory under my user account. (ie. http:\\server\myaccount MySQL database is on a different server, under phpmyadmin (ie, http:\\otherserver\phpmyadmin Just wondering how I should be connecting to MySQL database? I assume that "$hostname" will not be "localhost" and should infact be the url that the database is on, and then have the database name, username and password for it? Cheers
Re: Connecting to SQL database in a different directory/server to website Your assumptions would appear to be correct.. I imagine it would look something like this (this is asp though) - Hope that helps
that looks more like ASP to me Chandler! I just ended up using the IP address, and its as simple as $host = "<ip-address>" followed by your MySQL connect statements edit: missed the fact that you said it was ASP