8 byte Integer with Doctrine and PHP
- by Rufinus
Hi,
the players:
64bit linux with
php 5 (ZendFramework 1.10.2)
PostgreSQL 7.3
Doctrine 1.2
Via a Flash/Flex client i get an 8byte integer value.
the field in the database is an BIGINT (8 byte)
PHP_INT_SIZE show that system supports 8byte integer.
printing out the value in the code as it is and as intval() leads to this:
Plain: 1269452776100
intval: 1269452776099
float rounding failure ?
but what really driving me nuts is
ERROR: invalid input syntax for integer: "1269452776099.000000"'
when i try to use it in a query. like:
Doctrine_Core::getTable('table')->findBy('external_id',$external_id);
or
Doctrine_Core::getTable('table')->findBy('external_id',intval($external_id));
How i am supposed to handle this ? or how can i give doctrine a floating point number which it should use on a bigint field ?
Any help is much appreciated!
TIA