I'm using php-activerecord
to manage my MySQL entries.
The block of code where the problem ocurs is the following:
$item->id = $result->id;
$item->save();
var_dump($result->id); // string(10) "2386737351"
var_dump($item->id); // int(2147483647)
The problem is that $result->id
is string(10) "2386737351"
like it should, but $item->id
becomes int(2147483647)
. My column id
is of type BIGINT
, so no problem there.
It looks like php-activerecord
converts that value to a int again which is capped at it's maximum value of 2147483647.
Obviously this is terribly wrong and causes Duplicate entry '2147483647' for key 'unique'
.
How can I overcome this?