When querying data out of MySQL into PHP, all values from MySQL arrive in PHP as strings, even if the MySQL column type is INT. This is documented behavior, but I was wondering if someone could explain why this is the case.
The data type returned by MySQL corresponds to the column type, so why doesn't PHP simply return the values as is? I know PHP is a loosely typed language, but I do not see the reason for the conversion?
If someone knows a configuration change to stop this behavior let me know.
Thanks,
Itshim
The data type returned by MySQL corresponds to the column type, so why doesn't PHP simply return the values as is? I know PHP is a loosely typed language, but I do not see the reason for the conversion?
If someone knows a configuration change to stop this behavior let me know.
Thanks,
Itshim