PHP/MySQL won't update decimal field

Posted by Serhiy on Stack Overflow See other posts from Stack Overflow or by Serhiy
Published on 2010-05-21T20:42:16Z Indexed on 2010/05/21 20:50 UTC
Read the original article Hit count: 218

Filed under:
|
|
|
|

I have this query:

UPDATE table_name 
  SET field_1 = field_1 +100,
      field_2 = field_2 +100,
      field_3 = field_3 +100
WHERE id = 1 
LIMIT 1;

Where Field_1 is regular integer, Field_2 is decimal(15,6) and Field_3 is double(15,6). When I run this query from php script they update just field_1 and nothing happen with field_2 and field_3 they just stay as before. But when I run in phpMyAdmin it's work without any problems.

I'm tried to lock tables, make round() before run update, nothing help.

Please help... why I can't update decimal and float fields from php?

PHP version: 5.2 Mysql version 5

© Stack Overflow or respective owner

Related posts about mysql

Related posts about php