3 回答

TA貢獻1850條經驗 獲得超11個贊
您將獲得布爾值,而不是值本身。請記住,如果給定值存在并且將其存儲為1則isset()返回true。我想您打算檢查值是否存在,請按照以下步驟操作:
$textareamsg = isset($_GET['textarea'])? $_GET['textarea'] : '';
$title = isset($_GET['title'])? $_GET['title'] : '';
$reciver = isset($_GET['reciver'])? $_GET['reciver']: '';
而且您還應該存儲這樣的字符串值:
if (isset($_GET['sendmsg'])) {
$sql_msg = mysqli_query($link, 'INSERT INTO messaging (title, message, sender, reciver) VALUES ("' . $title . '","' . $textareamsg . '","' . $Ccode . '","' . $reciver . '"');
}
希望對您有所幫助:)

TA貢獻1772條經驗 獲得超6個贊
好,謝謝大家。我確實嘗試過,并且可以正常工作:
$textareamsg = $_GET['textarea'];
$title = $_GET['title'];
$reciver = $_GET['reciver'];
if (isset($_GET['sendmsg'])) {
$sql_msg = mysqli_query($link, "INSERT INTO messaging (title, message, sender, reciver) VALUES ('$title','$textareamsg', '$ccode','$reciver')");
}
- 3 回答
- 0 關注
- 200 瀏覽
添加回答
舉報