Entry
What PHP type is used to hold values from a database?
Why are all results from a database query made into strings in PHP?
I can't convert TEXT in MySQL after retrieve to String in php3. String parse error occurs. How?
Jul 12th, 1999 02:04
Nathan Wallace, Yeo Chin Yi, Rasmus Lerdorf
It's a feature. PHP has 3 basic data types. Databases have many many
more times that. Attempting to map 50 datatypes into 3 is going to be
extremely messy. PHP2 worked like that and it was extremely confusing.
PHP3 is consistent and always does the same thing, so there is no
confusion. You always get strings and you never lose data nor
precision.
It is better to leave it up to the script writer what to do with the
data than having PHP magically trying to determine what to do.