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

c# - Better 64-bit byte array hash -

webrtc - Which ICE candidate am I using and why? -

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