I have extremely strange problem, which drives me crazy all day. I have a simple MySQL table with few columns. One column is int(11) NULL. When I update its value, it works as expected. However, when I update its value second time, it gets assigned “0” value.
I have tested this same behaviour on my MySQL 5.1.58-1ubuntu1 and on other MySQL 5.0.96-community and both behave exactly the same. So it apparently is not problem of one version MySQL.
It is difficult for me to explain, but I have attached 2 screenshots which will tell you much better where is the better.
First screenshot is structure of my table I am updating:

And here is shown SQL queries beeing executed, where you can see, that first update is correct and the second produces “0” value in column “invoice_number” with no reason:

Am I overlooking something obvious ? It really drives me crazy, because it doesn’t make any sense to me…
Thank you for any help in advance…
EDIT: I have tried using only numbers in my queries and this is result (very strange for me as well):

Ok, I finally figured it out. The problem was somewhere else, not in MySQL itself. I have copied all those SQL queries shown in my question from MySQL query log, so I never suspected there could be something weird. However there was – UTF-8 Byte order mark (EF BB BF) at the beginning of the “35” value and it was, of course, not visible.
The first update query had its origin from different place of my app and its value “30” was only string(2). But when I did var_dump on values in the second query, I noticed that “35” is actually string(5). This value came from jQuery’s $.get() call and had this BOM attached to it …
Two days of life spent on such an “invisible”…