Really weird!
Posted: Mon Jul 21, 2003 11:26 pm
This piece of code
is run to put a phone number into a database. The total number of characters they can have is 14, and the minimum is 7. Now when they put up to 9 characters it records into the database just fine. When they put that 10th character in the number that gets updated into the database isn't the number submitted.
So if I put 555 5555 (minus the space) that number gets recorded into the database, but if I put 555 555 5555 this number somehow is put in the database 2147483647 (actual number generated). Anybody know why this is?
Code: Select all
$new_phone_num = $_POSTї'phone_num'];
if($submit) {
if(!empty($new_phone_num)) {
if(strlen($new_phone_num) > 14 or strlen($new_phone_num) < 7) {
echo "<font class="css-error">*Phone numbers have a 14 character max and a 7 character minimum.</font><br>";
} else {
$mysql_query = "UPDATE rp_users SET phone_num = '$new_phone_num' WHERE userid = '$userid'";
$mysql_query_result = mysql_query($mysql_query);
$phone_num = $new_phone_num;
}
}
}So if I put 555 5555 (minus the space) that number gets recorded into the database, but if I put 555 555 5555 this number somehow is put in the database 2147483647 (actual number generated). Anybody know why this is?