mysqli_error() will provide the error for $cnx = mysqli_connect() is mysqli_query has failed providing boolean of false.