Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PDO::PARAM_FLOAT does not exist, why?

Tags:

sql

php

pdo

I wonder why the PDO::PARAM_FLOAT does not exist and what can replace it?

like image 979
Jérémy Dupont Avatar asked Mar 02 '12 00:03

Jérémy Dupont


1 Answers

There is none, probably due to implied rounding issues.

Just use PDO::PARAM_STR and convert the float to a string using strval($float) or (string) $float.

like image 57
apfelbox Avatar answered Sep 19 '22 18:09

apfelbox