2012-10-10 41 views
0

我的用戶註冊表中有一個用於聯繫號碼(手機號碼)的字段,其長度爲10位數字。我使用正常的整數字段,它給我「超出範圍」錯誤在用戶註冊表格中添加一個10位數字的字段在Drupal 7中

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)VALUES(: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); Array [[:db_insert_placeholder_0] => user [:db_insert_placeholder_1] => 26 [:db_insert_placeholder_2] => 26 [:db_insert_placeholder_3] => user [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => und [:db_insert_placeholder_6] => field_sql_storage_field_storage_write()(C:\ wamp \ www \ ANICBS \ modules \ field \ modules \ field_sql_storage \ field_sql_storage.module)的第449行。

Drupal核心似乎沒有長整型字段。我該如何解決這個問題?

我甚至試圖在數據庫中直接將字段類型改爲「BIG INT」。但錯誤仍然存​​在。

+0

你可以使用文本字段,但你必須做你自己的數字驗證。 – nmc

+0

我想到了這個選擇..但我正在尋找更好的方式來做到這一點。 –

回答

0

PDOException:SQLSTATE [22003]:在第1行1264輸出列 'field_contact_numbers_value' 範圍值的:數值超出範圍INSERT INTO {field_data_field_contact_numbers}(ENTITY_TYPE,ENTITY_ID, REVISION_ID,捆綁,增量,語言,field_contact_numbers_value) VALUES(: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] =>學院[:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => UND [:db_insert_placeholder_6 ] => 23432534646 [:db_insert_placeholder_7] =>節點[:db_insert_placeholder_8] => 103894 [:db_insert_placeholder_9] => 111454 [:db_insert_placeholder_10] =>學院[:db_insert_placeholder_11] => 1:db_insert_placeholder_12] => UND [ :db_insert_placeholder_13] => 2345235345)在field_sql_norevisions_field_storage_write()

我有同樣的問題。然後我使用文本字段並進行驗證。

相關問題