所以我有這個,的MySQL(和/或)PHP問題
<?php
require "database.php";
$to=$_GET['toF'];
$content=$_POST['message_contentl'];
$from=$_GET['fromF'];
$ck_reciever = "SELECT Username FROM accounts WHERE username = '".$to."'";
if(mysql_num_rows(mysql_query($ck_reciever)) == 0){
die("The user you are trying to contact don't exist. Please go back and try again.<br>
<form name=\"back\" action=\"Send_FR.php\" method=\"post\">
<input type=\"submit\" value=\"Try Again\">
</form>
");
}else{
$a1 = $_POST['message_contentl'];
$a2 = $_GET['fromF'];
$a3 = $_GET['toF'];
mysql_query("INSERT INTO Friends (fr_message, From, To) VALUES ('$a1', '$a2', '$a3')"); OR die("Could not send the message: <br>".mysql_error());
echo "The Friend Request Was Successfully Sent!";
?>
但它不工作。
它所做的就是給我這個錯誤消息:
您的SQL語法錯誤;請在第1行檢查與您的MySQL服務器版本對應的正確語法的手冊,以便使用'From,To')VALUES('','Extro','Syncro')'
請幫忙?
請問fr_message列接受空值? –
[由於在MySQL中使用保留字作爲表或列名而導致的語法錯誤]的可能重複(http://stackoverflow.com/questions/23446377/syntax-error-due-to-using-a-reserved-word -as-A-表或列名稱合的MySQL) –