What is the best way to bind decimal / double / float values with PDO in PHP?

前端 未结 3 756
面向向阳花
面向向阳花 2020-12-03 17:14

It appears the class constants only cover PDO::PARAM_BOOL, PDO::PARAM_INT and PDO::PARAM_STR for binding. Do you just bind decimal / f

3条回答
  •  情书的邮戳
    2020-12-03 17:45

    If you really want to use PDO you'll have to enter it as an PARAM_INT, but I never use a specification for double.

    It is an optional parameter to specify the PDO type.

    I guess you would better not set the PDO type for doubles.

提交回复
热议问题