PDO::PARAM_DOUBLE
| From: | Adam Baratz | Date: | Wed, 07 Dec 2016 21:39:44 +0000 |
| Subject: | PDO::PARAM_DOUBLE | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-97328@lists.php.net to get a copy of this message | ||
If you want to bind a double to a statement, the accepted approach is to
bind as a string:
http://stackoverflow.com/questions/2718628/pdoparam-for-type-decimal
However, this means that prepared statements see these values as strings.
This can cause issues, for example:
http://stackoverflow.com/questions/38105900/sqlite-having-comparison-error
pdo_mysql will actually watch for doubles, but this code will never be
reached since all doubles are cast to strings:
https://github.com/php/php-src/blob/3f25c4228a8f505a000c1ea5751062606247349a/ext/pdo_mysql/mysql_statement.c#L563
Is there a reason PDO::PARAM_DOUBLE doesn't exist?
Thanks,
Adam