How to user Int64 in php like dotnet、java、c++?
For example:
The datatype is bigint(20) in mysql,I want to save value from php.I know one solution is using string in mysql procedures.
table case:
CREATE TABLE `test_int64` (
`id` bigint(20) unsigned NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
mysql procedures case:
CREATE PROCEDURE `sp_test_int64`(IN p_id VARCHAR(20))
NOT DETERMINISTIC
SQL SECURITY DEFINER
COMMENT ''
BEGIN
INSERT INTO test_int64(id) VALUES(p_id+0);
END;
php code case:
$id = '1660820628901389'; Then execute sql 'call sp_test_int64(\''.$id.'\')'
The above method is OK, but I don't want to do it. Are there any other solutions?
example 2:
I want to use PHP read MYSQL data output JSON code like this:
{
"id":1660820628901389
}
but not :
{
"id":"1660820628901389"
}
I don't know how to do?