If in doubt, read the manual:
PHP: mysqli_connect - Manual[
^] It says:
Quote:
If mysqli exception mode is not enabled and a connection fails, then mysqli_connect() returns false instead of an object.
That isn't the same as "if it succeeds, it returns
true
".
If it succeeds, it returns a connection object you can use, not a boolean value.
Change your test to check for
false
instead of
true