I was studying an example from mysqli connection and I am confused! the method connect_error returns string or null.so how can we use it in an if condition when is doesn't return true or false? example code:
<?php
$servername="localhost";
$username="root";
$password="";
$dbname="example";
$conn=new mysqli($servername,$username,$password,$dbname);
if($conn->connect_error){
die("connection is failed".$conn->connect_error);
}
?>