Mysql 2147483647上的Varchar问题 [英] Varchar issue on Mysql 2147483647
问题描述
存在2147483647
MYSQL问题.
Having the 2147483647
MYSQL issue.
在电话字段中插入一个11位数的电话号码时,我得到的是该号码,并将其保存在DB: 2147483647
When inserting an 11 digit number in the telephone field i am getting this number in return saved in the DB: 2147483647
电话设置为VARCHAR
而不是INT
严格.
TEL is set as VARCHAR
not INT
tough.
此外,在以SERVER
1托管的数据库上,我具有完全相同的数据库表,并且没有相同的问题吗?!可能是什么?
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?
这是SQL和PHP
tel_no varchar(20) utf8_general_ci Yes NULL
mob_no varchar(20) utf8_general_ci Yes NULL
那是MYSQL.是的,我正在数据库中插入一个11位数字作为字符串
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是mysql的最大int值.只需将类型从int更改为bigint.
2147483647 is the largest int value for mysql. Just change the type from int to bigint.
这篇关于Mysql 2147483647上的Varchar问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!