這個sql查詢不工作:PHP MySQL命令語法錯誤
$sql = "INSERT INTO top(topic_subject,topic_date, topic_cat, topic_by)
VALUES(" . mysql_real_escape_string($_POST['topic_subject']) . " , NOW()," . mysql_real_escape_string($_POST['topic_cat']) . " , " . isset ($_SESSION['user_id']) . ")";
我該如何解決?我收到此錯誤消息。
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 2`
1.你沒有引用你的字符串。 2.參數化您的查詢。 – Sammitch