table: CREATE TABLE `am_graph` ( `id` int(3) unsigned NOT NULL auto_increment, `total` decimal(7,2) default NULL, `gyear` int(4) default NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; Insert query: INSERT INTO am_graph(total, gyear) VALUES(106229.33, 2010) Result is: 3 99999.99 2010 Total is showing value 99999.99. Can you please tell me whats wrong in my query? Why mysql is not saving actual total (106229.33)?
Your total column isn't large enough. 7,2 means 7 digits total with 2 decimals, basically 5 before the decimal, 2 after. You're trying to enter a number that would require 8,2. If you increase to 8,2 or 9,2 it should be fine.