mysql - PHP MySQLi can't update field where specific BIGINTS -


i update on 50000 rows bigint 13 - 14 numbers long. there (very few, under 0.01%) ints can't use update fields. try yourself:

create table(artikel) fields:

  • field(bigint) value 4030521732735
  • stuff(text) value abc

and try:

mysqli_query($con, "update artikel set stuff = 'newabc' field = 4030521732735"); 

isn't field getting updated too? if yes, wrong int? ideas how fix this? sorry bad english

update:

i tried it's not working:

$bigint = gmp_init("4030521732735"); $bigint_string = gmp_strval($bigint);  mysqli_query($con, "update test set stuff = 'newabc' field = $bigint_string"); 

and

$int = strval("4030521732735");  mysqli_query($con, "update test set stuff = 'newabc' field = $int"); 

this problem had in fact nothing ints or bigints or whatever... quite long discussion brought conclusion strings not escaped before sending db (strings occasionnaly containing quotes) ;-)


Comments

Popular posts from this blog

javascript - Bootstrap Popover: iOS Safari strange behaviour -

Magento/PHP - Get phones on all members in a customer group -

session - Logging Out Using PHP -