LoginSignup
0
0

More than 1 year has passed since last update.

MySQLのINSERTで合ってるはずなのに構文エラー1064が出て嫌になったとき

Posted at

MySQLには結構な数の予約語があります

カラム名に予約語を使用したテーブルにINSERTするとエラーを吐きます

ERROR 1064 (42000): 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 1

もし説明文を格納するカラム名にdesc等を使用している場合、バッククォート「`」で囲んであげる必要があります

INSERT INTO item(name, `desc`) VALUE ('ホゲホゲ', 'これはフガフガです');
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0