0

我的用户注册表单有一个 10 位数长的联系号码(手机号码)字段。我使用了一个普通的整数字段,这给了我“超出范围”错误

PDOException:SQLSTATE [22003]:数值超出范围:1264 第 1 行的“field_mobile_number_value”列的值超出范围:INSERT INTO {field_revision_field_mobile_number}(entity_type、entity_id、revision_id、bundle、delta、language、field_mobile_number_value)值(: db_insert_placeholder_0,:db_insert_placeholder_1,:db_insert_placeholder_2,:db_insert_placeholder_3,:db_insert_placeholder_4,:db_insert_placeholder_5,:db_insert_placeholder_6);数组 ( [:db_insert_placeholder_0] => 用户 [:db_insert_placeholder_1] => 26 [:db_insert_placeholder_2] => 26 [:db_insert_placeholder_3] => 用户 [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => und [:db_insert_placeholder_6] => 9841232323 )在 field_sql_storage_field_storage_write() (C 的第 449 行:

Drupal 核心中似乎没有长整数字段。我该如何解决这个问题?

我什至尝试直接在数据库中将字段类型更改为“BIG INT”。但错误仍然存​​在。

4

4 回答 4

1

您可以尝试 cck_phone 模块,否则将其作为文本字段并对其应用验证。

http://drupal.org/project/cck_phone

于 2012-11-20T12:03:14.553 回答
1

您可以尝试http://drupal.org/project/bigint,让您拥有真正的 BigInt (19) 值。

于 2012-11-28T05:30:14.677 回答
0

PDOException:SQLSTATE [22003]:数值超出范围:1264 第 1 行的“field_contact_numbers_value”列的值超出范围:INSERT INTO {field_data_field_contact_numbers}(entity_type、entity_id、revision_id、bundle、delta、language、field_contact_numbers_value)值(: db_insert_placeholder_0,:db_insert_placeholder_1,:db_insert_placeholder_2,:db_insert_placeholder_3,:db_insert_placeholder_4,:db_insert_placeholder_5,:db_insert_placeholder_6),(:db_insert_placeholder_7,:db_insert_placeholder_8,:db_insert_placeholder_9,:db_insert_placeholder_10,:db_insert_placeholder_11,:db_insert_placeholder_12,:db_insert_placeholder_13); 数组 ( [:db_insert_placeholder_0] => 节点 [:db_insert_placeholder_1] => 103894 [:db_insert_placeholder_2] => 111454 [:db_insert_placeholder_3] => 学院 [:

我有同样的问题。然后我使用文本字段并进行验证。

于 2015-09-08T10:46:43.443 回答
-1

根据https://www.drupal.org/node/1003692#comment-6097068 ,只有当整数类型小于 < -2.147.483.648 OR GREATER THAN> 2.147.483.647时,您才能存储 。

于 2015-03-04T12:01:05.130 回答