I have a MySQL table that uses a float type for one of its columns. Some of the values can also be integers. Simple, right?
When I do a query against this table, queries for ints work fine, but they don't work at all for floats:
$sql = "SELECT * WHERE MyCol = 5.6" does not work.
But $sql = "SELECT * WHERE MyCol = 5" does.
I have declared this column as a float type with the parameters (2,1) as the column numbers will never exceed 99.9.
This should be a no-brainer, but I can't get the query to work. The result set returns nothing for records with floats in that column! Gotta be some hidden spec somewhere.
A search of the MySQL docs and PHP has turned up nothing.