I am new to programming so plz forgive my stupid question. I have seen code like this:
$result1 = mysqli_query($connection,
"INSERT INTO Categories (CategoryName) VALUES ('Philosophy')");
if ($result1) {
/* commit transaction */
mysqli_commit($connection);
}
I am not quite sure what does if ($result1) mean, normally when we check condition in if statement, it should be something that can generated true or false explicitly, so the syntax should be if(true) or if(false), for example, if (1==1) is equivalent to if(true), so how about if ($result1)? $result1 itself donesn't generate true or false
Aucun commentaire:
Enregistrer un commentaire