After searching, I found a lot of problems out of range with people, not knowing that the first digit, m, in decimal (m, n) is the total number of digits. However, this is not my problem.
For the column in question, I have the following:
Field | Type | Null | Key | Default | Extra
preco | decimal(50,2) unsigned | NO | | 0.00 |
The decimal (50.2) parameter is more than I really want or need. I really want only 10 digits. Its price, therefore nothing more than 100 million, is probably ridiculous, so decimal (10.2) is likely to be more suitable. However, MySQL does not accept the following query:
INSERT INTO `produto` (`tipo_id`, `preco`, `qtd`, `opcao1`) VALUES (110, '77888555.43', '10', 'Azul')
I tried the query through CodeIgniter, phpMyAdmin and directly in the MySQL command line client. I also tried this without quotes for decimal value, but always get the same error:
"Out of range value for preco column in row 2"
source
share