数据库布局:PHP - 插入SQL错误
rid (auto increment) (primary key) (255)
song (varchar) (120)
artist (varchar) (30)
by(varchar) (33)
key(varchar) (60)
PHP代码:
$sql = "INSERT INTO Requests (song,artist,by,key)
VALUES ('$song','$artist','$by','$key')";
if($this->db->query($sql))
{
die("true");
}
echo 'false: ' . $this->db->error;
错误:
false: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'by,key) VALUES ('testsong','testing','kyle','example')' at line 1
帮助?我有很多年了,我看不出这个SQL有什么问题?提前致谢!
*“我已经探听了很长时间,我看不出这个SQL有什么问题吗?” - “靠近'键)' - MySQL甚至会告诉你它在哪里“启动”。 –
是的,所以我检查了数据库的列中正确的,检查过的语法 - 抱歉,我不知道那些被截断的单词存在,我会尝试知道我下一次从未教过的东西,不要担心@ Fred-ii - – KDOT