mysql 2147483647,Mysql 2147483647上的Varchar问题

Having the 2147483647 MYSQL issue.

When inserting an 11 digit number in the telephone field i am getting this number in return saved in the DB: 2147483647

TEL is set as VARCHAR not INT tough.

Also, on a database hosted on SERVER 1 i have the same exact database table and not having the same issue tough?! what might be?

This is the SQL and PHP

tel_no varchar(20) utf8_general_ci Yes NULL

mob_no varchar(20) utf8_general_ci Yes NULL

That's the MYSQL. Yes i am inserting an 11 digit number as string in the DB

$telno = GetValue($post['tel_no']);

$mobno = GetValue($post['mob_no']);

$sql = "UPDATE ".$this->dbpre."bookings SET tel_no='$telno', mob_no='$mobno'...

Can you please help? I am getting crazy!

解决方案

2147483647 is the largest int value for mysql. Just change the type from int to bigint.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值