Skip to content
Snippets Groups Projects
Commit 1e5813d4 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Made it possible to connect to mysql databases running on non-standard

  ports.  Patch by Alastair.
parent 66c5b707
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -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");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment