Php reads the double type of mysql with incorrect decimal point

data table design
clipboard.png


clipboard.png

php:

clipboard.png

Php
Apr.18,2022
The double type of

mysql is a floating point number, which is the saved floating point difference. For more information, please see here . The same is true for other languages. The price is recommended to use decimal type.


this problem occurs when you use json_encode since php7.1 . You can first convert a floating point number to a string


just keep two decimal places rounded.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b376f6-2c0c0.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b376f6-2c0c0.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?