php - comapring with boolean using triple equals for result set of mysql query -


this question has answer here:

why using triple equals here compare ?

if ($conn->query($sql) === true) {     echo "new record created successfully"; } 

many php functions may return mixed types, unlike many other languages. if compare ==, values tested. therefore non-zero value equal true, , things 123 == '123abc' true.

the === operator requires types same also, object not equal true , 123 === '123' doesn't equal true.


Comments

Popular posts from this blog

php - Zend Framework / Skeleton-Application / Composer install issue -

c# - Better 64-bit byte array hash -

python - PyCharm Type error Message -