MySQL Database Find out the Host
Moderator: General Moderators
- tecktalkcm0391
- DevNet Resident
- Posts: 1030
- Joined: Fri May 26, 2006 9:25 am
- Location: Florida
MySQL Database Find out the Host
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.
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.