From 8f5cac92662d8df0546801b6eafcdab54ba0315b Mon Sep 17 00:00:00 2001 From: Patrick Cronin Date: Sun, 29 Sep 2019 21:12:04 -0400 Subject: [PATCH] (Fix #359) mysqli docs use empty string for no db name PHP docs for mysqli's constructor (https://www.php.net/manual/en/mysqli.construct.php) show that the default value for $dbname is an empty string. So, if we want to use parameters after $dbname in the call without specifying a database name, we should be using an empty string instead of a NULL. --- include/dblayer/functions_mysqli.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/dblayer/functions_mysqli.inc.php b/include/dblayer/functions_mysqli.inc.php index 63d2babbf..84390f1c8 100644 --- a/include/dblayer/functions_mysqli.inc.php +++ b/include/dblayer/functions_mysqli.inc.php @@ -47,7 +47,7 @@ function pwg_db_connect($host, $user, $password, $database) list($host, $port) = explode(':', $host); } - $dbname = null; + $dbname = ''; $mysqli = new mysqli($host, $user, $password, $dbname, $port, $socket); if (mysqli_connect_error())