sql - MySQL query adds 0 to DB yet log says otherwise? -
i have table 3 columns, | id | systemid | vendortxcode |.
id = 1, systemid = -1, vendortxcode = 1
i'm running following query:
update core_licences set systemid = '51' vendortxcode = '1' it works no errors, systemid in table changes 0 not 53. opened mysql.log , looks fine:
110 prepare update core_licences set systemid = ? vendortxcode = ? 110 execute update core_licences set systemid = '51' vendortxcode = '1' php fine, not reporting errors, , can see mysql.log file above, query being built , executing fine. what cause table field updated '0' when update query working fine?
the field int allowing 30 characters. have tried varchar no luck. have tried i , s when binding query parameters.
everything fine, i'm 100% sure. it's damn table field! i've deleted systemid column , recreated it, no luck.
this doesn't explain situation, remember rather '1' not thing same 1, , '51' not same 51. you're forcing data type conversion, , looks conversion '1' 1 succeeds, query matches correct record, somehow conversion '51' 51 fails, such result null, , mysql treat 0 if null not allowed in column.
Comments
Post a Comment