Forum Moderators: coopster
I'm using php to display information ( name and phone numbers ) from a mysql database, and it's all just peachy keen, but the phone numbers are scrambled if the area code is included.
( That is to say, if there are more than seven numbers in the number. )
This is the php :
<?php
if ($submit) {
// process form
$db = mysql_connect("******", "*****", "*****");
mysql_select_db("spookypurpledragon",$db);
$sql = "INSERT INTO call (name,phone_number) VALUES ('$name','$phone_number')";
$result = mysql_query($sql);
echo "Thank you! Information entered.\n";
} else{
// display form
?>
<form method="post" action="<?php echo $PHP_SELF?>">
Name:<input type="Text" name="name"><br>
Phone_number:<input type="Text" name="phone_number"><br>
<input type="Submit" name="submit" value="Enter information">
</form>
<?php
} // end if
?>
And just in case, here is how I created the database :
mysql -> create table call
> name VARCHAR (15),
> phone_number INT,
> ID INT NOT NULL AUTO_INCREMENT,
> primary key (id));
And if the phone number was, say, 14445556666, it displays as 48394729876. :?
Does anybody know why the phone numbers get scrambled?