I recently noticed some surprising behaviour by PHP/MySQL.
I have a table in a MySQL database with columns of type DECIMAL(4,2).
I use a query to select these values:
$result = mysql_query('SELECT * from tbl');
$details = mysql_fetch_array($result);
Then when I do a var_dump of the returned data - var_dump($details), I found that all the data was of string type!
Why is this? I would expect columns of type DECIMAL to go to floats in PHP?
Do I really have to cast them to the type I require?
Thanks