RainyMonth2006
پنج شنبه 20 تیر 1392, 14:29 عصر
سلام
جدولي با فيلدهاي زير دارم و ميخواهم و اطلاعات موجود در Query string رو در جدول بريزم
/**
* from int(11)
2 to int(11)
3 text text
4 keyword text
5 enteredDate text
6 charset text
7 smsc text
8 udh text
9 checkingMessageId int(11)
*/
$from = (isset($_GET['from'])) ? $_GET['from'] : null; // from number
$to = (isset($_GET['to'])) ? $_GET['to'] : null; // to number
$text = (isset($_GET['text'])) ? $_GET['text'] : null; // content of the message
$keyword = (isset($_GET['keyword'])) ? $_GET['keyword'] : null; // keyword
$enteredDate = (isset($_GET['edate'])) ? $_GET['edate'] : null; // entered date
$charset = (isset($_GET['charset'])) ? $_GET['charset'] : null; // charset
$smsc = (isset($_GET['smsc'])) ? $_GET['smsc'] : null; // smsc
$udh = (isset($_GET['udh'])) ? $_GET['udh'] : null; // udh
$checkingMessageId = (isset($_GET['chkid'])) ? $_GET['chkid'] : null; // checking message Id
$sql = mysql_query ("INSERT INTO `test` (`from`, `to`, `text`, `keyword`, `enteredDate`, `charset`, `smsc`, `udh`, `checkingMessageId`)
VALUES ('$from', '$to' ,'$text' , '$keyword' ,'$enteredDate', '$charset', '$smsc' , '$udh', '$checkingMessageId')");
افزودن اطلاعات در جدول انجام مي شود ولي مثلا اگر در query string به صورت زير داشته باشم، فيلد from و to در جدول با مقداري غير از انچه بايد باشد مثل 2147483647 ذخيره مي گردد و همينطور در فيلد text چيزي نيست
http://test.com?from=91212345678&to=100012345&text=test
مشكل اين تكه كد كجاست.؟
جدولي با فيلدهاي زير دارم و ميخواهم و اطلاعات موجود در Query string رو در جدول بريزم
/**
* from int(11)
2 to int(11)
3 text text
4 keyword text
5 enteredDate text
6 charset text
7 smsc text
8 udh text
9 checkingMessageId int(11)
*/
$from = (isset($_GET['from'])) ? $_GET['from'] : null; // from number
$to = (isset($_GET['to'])) ? $_GET['to'] : null; // to number
$text = (isset($_GET['text'])) ? $_GET['text'] : null; // content of the message
$keyword = (isset($_GET['keyword'])) ? $_GET['keyword'] : null; // keyword
$enteredDate = (isset($_GET['edate'])) ? $_GET['edate'] : null; // entered date
$charset = (isset($_GET['charset'])) ? $_GET['charset'] : null; // charset
$smsc = (isset($_GET['smsc'])) ? $_GET['smsc'] : null; // smsc
$udh = (isset($_GET['udh'])) ? $_GET['udh'] : null; // udh
$checkingMessageId = (isset($_GET['chkid'])) ? $_GET['chkid'] : null; // checking message Id
$sql = mysql_query ("INSERT INTO `test` (`from`, `to`, `text`, `keyword`, `enteredDate`, `charset`, `smsc`, `udh`, `checkingMessageId`)
VALUES ('$from', '$to' ,'$text' , '$keyword' ,'$enteredDate', '$charset', '$smsc' , '$udh', '$checkingMessageId')");
افزودن اطلاعات در جدول انجام مي شود ولي مثلا اگر در query string به صورت زير داشته باشم، فيلد from و to در جدول با مقداري غير از انچه بايد باشد مثل 2147483647 ذخيره مي گردد و همينطور در فيلد text چيزي نيست
http://test.com?from=91212345678&to=100012345&text=test
مشكل اين تكه كد كجاست.؟