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 关注
- 164 浏览
添加回答
举报