I'm giving correct contact number in the form field but it gets saved into database in some random digits,Why so?.i'm not using any encryption method!
Asked
Active
Viewed 241 times
-6
-
2Post your code, how is anyone meant to know what you are on about... – Ian May 04 '17 at 15:44
-
Is the number that's being stored `2147483647`? – ceejayoz May 04 '17 at 15:51
-
problem solved ! it was problem with database column data-type.i changed it from "int" to "varchar".Now contact number got saved in correct form. – Firdous bhat May 04 '17 at 15:51
-
That's what I suspected. – ceejayoz May 04 '17 at 15:51
-
yes @ceejayoz,exactly. – Firdous bhat May 04 '17 at 15:52
-
@ceejayoz,Why it isn't taking "int" type? – Firdous bhat May 04 '17 at 15:54
1 Answers
0
INT
has a max value of 2147483647
(or 214-748-3647
).
So, 555-555-5555
will get rewritten to the max it can store.
Phone numbers are NOT integers, so you shouldn't store them like that. All sorts of problems can happen - 055-555-5555
would be stored incorrectly as 55-555-5555
, 555-555-5555 x1234
can't be entered, etc.

ceejayoz
- 176,543
- 40
- 303
- 368