Hi Adam,

On 05/04/2017 17:30, Adam Baratz wrote:
> Hi,
> 
> The PDO extension does not have a type to represent floating point values.
> The current recommended practice is to use PDO::PARAM_STR.
> 
> I had poked at this topic in an earlier thread:
> https://externals.io/thread/551
> 
> There was some hesitation about how complicated this would be to implement.
> After looking through each of the supported drivers, it seems like it would
> actually be a fairly light lift. In some cases, switching PDO::PARAM_STR
> for a new float type constant will save a type cast and have the same
> results.
> 
> I wrote up a proposal here:
> https://wiki.php.net/rfc/pdo_float_type
> 
> I tried to be as thorough as possible in understanding the impact on each
> supported driver. I'd appreciate any feedback on this concept as well as
> its impact on drivers.

Thanks for that. I generally have very little use for float types on a
database, but I guess their support should have been included from day 1
in PDO.

That said, I think the proposed type is likely to be misused for
NUMERIC/DECIMAL fields, which would be pretty bad. Maybe we should also
add PDO::PARAM_NUMERIC in order to avoid mistakes?


Cheers
-- 
Matteo Beccati

Development & Consulting - http://www.beccati.com/

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to