I will try to make everything so simple. I am using the BIGINT data type in a MySQL database table. I have a function that generates a unique random number that can take from 12 to 13 digits.
When I insert a 12-digit number into the database, it enters it just fine,
but when I use a value that is 13 digits or more, it seems to be rounded or something like that. here
Php
$defaultText = 'some string';
$web_id = 12;
$element_id = 23112182735363;
mysql_query("INSERT INTO tableName (web_id, element_id, content)
VALUES ($web_id, $element_id, '".mysql_real_escape_string($defaultText)."')");
Results: in the case of one, it inserts a slightly different number, usually rounded for some reason.
in case two, he inserts the number just fine! Maybe someone can help shed light on this mystery! Thanks again!
large int data type:
bigint(200)
source
share