if(isset($_POST['submit']))
{
extract($_POST);
$query = "INSERT INTO Messages VALUES(null,'$user_id','$subject','$msg')";
mysqli_query($conn,$query) or die (mysqli_error($conn));
}
答案 0 :(得分:0)
您可以尝试此代码(检查$ _POST先不是空的然后执行):
if ( !empty($_POST['submit'])) {
$query = "INSERT INTO"
."Messages"
."VALUES"
."(null,'$user_id','$subject','$msg')";
mysqli_query($conn,$query) or die (mysqli_error($conn));
}