I have tables (MySQL) with lots of BIGINT values in them. And I have 2 computers where PHP code (based on Laravel framework) runs, getting values from those tables. On one machine (Mac OS) everything works fine, but another one (Debian jessie) makes me mad. The problem is, I can't use BIGINT values in queries. Here are a couple of examples of what I'm talking about:
Client::where('client_id', 10203629136783381)->first();
— returns null
Client::where('client_id', '10203629136783381')->first();
— returns correct result
\DB::select('SELECT * FROM clients WHERE client_id=?', [10203629136783381])
— returns an empty array
\DB::select('SELECT * FROM clients WHERE client_id=10203629136783381')
— returns correct result
If I just run a query directly in MySQL-client using BIGINT value as it is, not as a string, the query works fine.
I don't know how to fix this behavior and make my code understand BIGINT values. Both computers have 64bit architecture, PHP version is 5.6.29 on Mac and 5.6.30 on Debian.