我的交易号为6316732587130745043
(19 digits
)。
由于Integer不够,我在我的mysql数据库decimal(50,0)
但是,数据库中的值为6316732587130745000
(rounded to 17 digits
)
我从服务器请求中获得了交易号:
$sendInfo = file_get_contents($server.$request);
$obj_sendInfo = json_decode($sendInfo);
$transaction = $obj_sendInfo->{'transaction'};
我该如何解决?
答案 0 :(得分:2)
使用bigint
数据类型。我相信8字节的存储空间。这就是它的意思。二进制不浮点,精益和平均存储。
create table ph345
(
bi bigint not null
);
insert ph345(bi) values (6316732587130745043);
从ph345中选择*;
+---------------------+
| bi |
+---------------------+
| 6316732587130745043 |
+---------------------+
上的Mysql手册页