vinpkl — 2012-11-01T09:23:12-04:00 — #1
i used for getting phone number
$phone = intval($_POST['phone']);
if the number is equal to or more than 10 digits then i get this below number everytime
otherwise its fine for less than 10 digits
guido2004 — 2012-11-01T09:34:01-04:00 — #2
cpradio — 2012-11-01T10:32:43-04:00 — #3
The problem you are having is the phone number exceeds the maximum value an integer can hold. A PHP integer can hold a value up to 2147483647.
You will need to use the is_numeric() or the ctype_digit() function to check if you were given a numeric value.
vinpkl — 2012-11-01T11:04:44-04:00 — #4
what should be the column type in database for storing 10 digit numeric phone number
cpradio — 2012-11-01T11:31:46-04:00 — #5
I personally always use varchar(X) where X is the number of characters you want stored. The reason being, I don't want any leading zeros truncated.