$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を配置しましたが、機能していません。
- タイトル、エディション、作者、isbn、状態、説明、写真はすべてvarcharsです
- uidはintです
- 説明はテキストです