diff options
author | Dries Buytaert <dries@buytaert.net> | 2002-10-23 20:09:29 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2002-10-23 20:09:29 +0000 |
commit | 1e5813d4f49274ea64e2fc9165aaffad16b468bc (patch) | |
tree | 07ec836c3fefa24cab899761cce0c1949017cf9e | |
parent | 66c5b70736553b2c84eb8835e7b4c3ad7c34c8f8 (diff) | |
download | brdo-1e5813d4f49274ea64e2fc9165aaffad16b468bc.tar.gz brdo-1e5813d4f49274ea64e2fc9165aaffad16b468bc.tar.bz2 |
- Made it possible to connect to mysql databases running on non-standard
ports. Patch by Alastair.
-rw-r--r-- | includes/database.mysql.inc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/includes/database.mysql.inc b/includes/database.mysql.inc index a7151cefd..5e578fbc2 100644 --- a/includes/database.mysql.inc +++ b/includes/database.mysql.inc @@ -4,6 +4,11 @@ function db_connect($url) { $url = parse_url($url); + // Allow for non-standard MySQL port. + if ($url["port"]) { + $url["host"] = $url["host"] . ":" . $url["port"]; + } + mysql_pconnect($url["host"], $url["user"], $url["pass"]) or die(mysql_error()); mysql_select_db(substr($url["path"], 1)) or die("unable to select database"); |