fix for issue 1011 - set PDO type int for double vars#1020
fix for issue 1011 - set PDO type int for double vars#1020axelhahn wants to merge 1 commit intocatfan:masterfrom
Conversation
|
have the same problem |
|
I'm having the same issue, if it's a simpe change i wander why the author does not include it. @axelhahn, does your solution works well with decimal numbers? |
|
@jxcodes Huuuh, it was a while ago hat I went ito that trap. If I have a look to https://www.php.net/manual/en/pdo.constants.php - it says: PDO::PARAM_INT (int)
Represents the SQL INTEGER data type. ... so: the answer is NO - it doesn't handle float values - it is an integer. https://www.w3schools.com/sql/sql_datatypes.asp Maybe my issue is, that my integer value was detected as "double" instead of "integer". If you need to handle a real float value handled as a double - this I didn't tested. Maybe the solution goes into the direction to use the current mappting to PDO::PARAM_STR but to add an if condition in https://github.com/catfan/Medoo/blob/master/src/Medoo.php#L756 that removes the quote chars from a string. |
|
The double data should be For |
set
'double' => PDO::PARAM_INTto prevent from the value quoting in generator().