<分区>
$query = "INSERT INTO textbooks (uid, title, edition, author, isbn, condition, description, photo) VALUES (9, 'q', 'a', 'b', 'c', 'd', 'e', '$extension')";
$result = mysql_query($query) or die('Could not connect: ' . mysql_error());
Could not connect: 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 'condition, description, photo) VALUES (9, 'q', 'a', 'b', 'c', 'd', 'e', '.jpg')' at line 1
我一直收到 MySQL 语法错误,但我终究无法找出问题所在。我放入随机变量、字符串和 int 只是为了测试,但它不起作用。
- title, edition, author, isbn, condition, description, photo are all varchars
- uid is an int
- description is text