Mod-Jay Posted March 28, 2011 Share Posted March 28, 2011 Hello, i made a text site, so you can text from a website. i was making a database of the texted numbers and i found that the mysql line is not inserting the correct number, its going to the max php one. Here the code: if (array_key_exists($carrier, $carriers)) { $correctCarrier = $carriers[$carrier]; $i = 0; while($i < $_POST['amount']){ $i++; $formatted_number = $to.$correctCarrier; $result = ("$i of Your Messages Has been sent to the number ". $_POST['to'] . ".<br>" . mail("$formatted_number", "$subject", "$message") . ""); } mysql_query("INSERT INTO `msgssent` (`number`, `numberofmsg`, `subject`, `message`) VALUES (". $_POST['to'] .", '". $i ."', '". $subject ."', '". $message ."')") Or die(mysql_error()); Echo $result; } Quote Link to comment https://forums.phpfreaks.com/topic/231907-mysql-and-php-number-inserting-problem/ Share on other sites More sharing options...
Pikachu2000 Posted March 28, 2011 Share Posted March 28, 2011 What does "the max php one" mean? Quote Link to comment https://forums.phpfreaks.com/topic/231907-mysql-and-php-number-inserting-problem/#findComment-1193100 Share on other sites More sharing options...
Mod-Jay Posted March 28, 2011 Author Share Posted March 28, 2011 Max Php number 2147416746... Quote Link to comment https://forums.phpfreaks.com/topic/231907-mysql-and-php-number-inserting-problem/#findComment-1193107 Share on other sites More sharing options...
Pikachu2000 Posted March 28, 2011 Share Posted March 28, 2011 I'm guessing you have the data type for the field in the table set to INT, right? Change it to BIGINT, or CHAR(10) for a 10 digit number. Quote Link to comment https://forums.phpfreaks.com/topic/231907-mysql-and-php-number-inserting-problem/#findComment-1193113 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.