The question is the title alone, in PHP we can do:
And in MySQL we can do:
SELECT campo_int FROM tabela WHERE campo_int = "!"
And if that
'0' it returns the record.
- Why does this happen?
- Does this have any usefulness planned by language developers?
When you run this command:
In fact it returns false since it could not cast for int, if you do this for example:
It will return 0 in the same way, since it can not convert to int, and in mysql it is the same, if you do so:
SELECT campo_int FROM tabela WHERE campo_int = "qualquerCoisaString"
It will return the values of the field_int that has the value 0, since its expression returned 0 (false).