Check for error on connect with mysqli

The mysqli class performs an incorrect check on connection

`mysql_connect()` returns false when there's a connection error, but `mysqli_connect()` does not. To check for connection problems, you need to use function `mysqli_connect_errno()`