Fix warning when the initial connection to the database fails
When `mysqli_connect` fails, `$link` becomes false, and the `or` branch is taken, which uses `mysqli_error($link)`, which in turn fails because `$link` is false. Since it's correctly checking `mysqli_connect_errno()` in the next line, just removing the `or` suffices. Per report by jonhboy Resident.
This commit is contained in:
parent
31b8538e51
commit
65ce40036a
1 changed files with 1 additions and 1 deletions
|
@ -31,7 +31,7 @@ ini_set('display_errors', '1');
|
|||
|
||||
require_once("settings-config.inc.php");
|
||||
|
||||
$link = mysqli_connect($dbhost, $dbuser, $dbpass, $dbname) or die("Error " . mysqli_error($link));
|
||||
$link = mysqli_connect($dbhost, $dbuser, $dbpass, $dbname);
|
||||
|
||||
if (mysqli_connect_errno()) {
|
||||
die ("Connect failed: " . mysqli_connect_error());
|
||||
|
|
Loading…
Reference in a new issue