Jump to content

if(mysqli_connect(...))


ala888

Recommended Posts

I've seen some individuals use the following method to validate whether or not an attempted connection to mySQL went through.

$CON = mysqli_connect("localhost","root","123456","test")if($CON){......}

First of all, I dont understand how an object evaluates to a boolean true. And secondly, how come mysqli_connect returns absolutely nothing when it does not work?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...