2

I've been trying to solve this problem for the whole day, and no solution yet.

I have a test bench on windows using XAMPP, when I retrieve a float value from the database, I get the value like this:
mysqli normal query : 0.67
mysqli prepared stmt: 0.67

but when I upload the script and test it on the web using php5-fpm and MariaDB on ubuntu, I get this results:
mysqli normal query : 0.67
mysqli prepared stmt: 0.6700000166893

I dont know why this variance between the precision of the two methods

1 Answers1

0

turns out that I have to use ini_set('precision', 2); that should do the work.

But still I don't know the reason why the usual query method returns results with precision already set without using ini_set('precision', 2);