SQLSTATE[HY000]: General error: 1366 Incorrect decimal value: ERROR
SQLSTATE[HY000]: General error: 1366 Incorrect decimal value: ERROR
meskimeski
Posts: 7Questions: 4Answers: 0
After updating mysql get error when creating new row
SQLSTATE[HY000]: General error: 1366 Incorrect decimal value: '' for column 'prepay' at row 1
Create
This discussion has been closed.
Answers
sounds like you are not formatting a decimal column properly for insert. if it is a decimal number it may only contain numbers and a decimal point. Everyhting else is not permitted. If you are using a different way of displaying your column in editor you need to use a set formatter on the server side. I use this logic in my setFormatter to get rid of 1,000 separators and decimal commas: English number format for 1 million and 99 cents is 1,000,000.99, German format is 1.000.000,99. This little routine converts both numbers into 1000000.99 which is what MySql understands.
Here is more detail on the formatters:
https://editor.datatables.net/manual/php/formatters#Formatter-methods
Use a custom formatter through a closure. That gives you more flexibility.