I have two tables with bigint:
table1
id bigint(20) PK autoincrement
name varchar(40),
text
table2
id bigint(20) PK autoincrement
created datetime
text_fiel
It's also the case that PHP under at least some 64-bit operating systems (eg FreeBSD AMD64) uses an 8-byte int, verifiable by testing with
echo 'Size of int is '.PHP_INT_SIZE ;
So if you're only going to be running a 64-bit operating system, you shouldn't need to manage the BIGINTs as strings in PHP.
I solved this problem by change to another php version,that is changing from 64bit php version to 32bit php version. That really works for me.
You need to CONVERT it to a string in SQL before getting it into PHP. In PHP, you can use GMP to handle the number.
MySQL docs on converting: http://dev.mysql.com/doc/refman/5.7/en/cast-functions.html#function_convert