Question

My user registration form has a field for contact number (mobile number) which is 10 digits long. I used a normal integer field which gives me "Out of range" error

PDOException: SQLSTATE[22003]: Numeric value out of range: 1264 Out of range value for column 'field_mobile_number_value' at row 1: 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] => 9841232323 ) in field_sql_storage_field_storage_write() (line 449 of C:\wamp\www\ANICBS\modules\field\modules\field_sql_storage\field_sql_storage.module).

There doesnt seem to be a field for long integers in Drupal core. How can I work around this?

I even tried changing the field type to "BIG INT" straight in the database. but the error presists.

Was it helpful?

Solution

you can try cck_phone module otherwise make it as text field and apply validation for it.

http://drupal.org/project/cck_phone

OTHER TIPS

You can try http://drupal.org/project/bigint, allows you to have a true BigInt (19) value.

PDOException: SQLSTATE[22003]: Numeric value out of range: 1264 Out of range value for column 'field_contact_numbers_value' at row 1: INSERT INTO {field_data_field_contact_numbers} (entity_type, entity_id, revision_id, bundle, delta, language, 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); Array ( [:db_insert_placeholder_0] => node [:db_insert_placeholder_1] => 103894 [:db_insert_placeholder_2] => 111454 [:db_insert_placeholder_3] => college [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => und [:db_insert_placeholder_6] => 23432534646 [:db_insert_placeholder_7] => node [:db_insert_placeholder_8] => 103894 [:db_insert_placeholder_9] => 111454 [:db_insert_placeholder_10] => college [:db_insert_placeholder_11] => 1 [:db_insert_placeholder_12] => und [:db_insert_placeholder_13] => 2345235345 ) in field_sql_norevisions_field_storage_write()

I had the same problem. Then I used text field and put validation.

According to https://www.drupal.org/node/1003692#comment-6097068, you can store only if the number is less than < -2.147.483.648 OR GREATER THAN> 2.147.483.647 in integer type.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top