0

I've created a new field in the registration form:

//goes on top of page along with other form vars
$phone = array(
    'name'  => 'phone',
    'id'    => 'phone',
    'value' => set_value('phone'),
    'maxlength' => $this->config->item('phone_max_length', 'tank_auth'),
    'size'  => 30,
);

//inserted into form
<?php echo form_label('Phone number', $phone['id']); ?>
<?php echo form_input($phone); ?>
<?php echo form_error($phone['name']); ?>

And I've updated the register controller in the necessary places,

as well as updating the Tank Auth library in rootdir/application/libraries/Tank_auth.php

I've also created a phone column in the users table. However, say the mobile phone input was 07879526831, in the table it ends up as 2147483647! Really weird, and I have no clue why. Anyone has any ideas?

styke
  • 2,116
  • 2
  • 23
  • 51

1 Answers1

1

2147483647 is the largest value that can be stored in a signed 32-bit integer. For a phone number, assuming you have a fixed set of characters, try using a char(10) for example. Or you could use a varchar, if your phone numbers will be stored with varying lengths.

radicalpi
  • 907
  • 1
  • 9
  • 29