Page 1 of 1

MySQL Database Find out the Host

Posted: Wed Sep 20, 2006 2:09 pm
by tecktalkcm0391
Is there a way to get PHP to tell you the host of a database, when its at localhost, so that if returns like a \home\database\data\ or what ever the thing would be.

Posted: Wed Sep 20, 2006 2:17 pm
by volka
:?:

Posted: Wed Sep 20, 2006 2:18 pm
by jwalsh
That doesn't make any sense. Without knowing the host, how can your software know that a database exists?

Posted: Wed Sep 20, 2006 3:01 pm
by Luke
Localhost is whatever host the script is currently on
php.net wrote:$_SERVER['SERVER_ADDR']
The IP address of the server under which the current script is executing.
$_SERVER['SERVER_NAME']
The name of the server host under which the current script is executing. If the script is running on a virtual host, this will be the value defined for that virtual host.