0
  CREATE TABLE post(
   'id' int UNSIGNED AUTO_INCREMENT,
   'title' VARCHAR(100),
   'content' VARCHAR(5000),
   'writer' VARCHAR(100),
   'updated_at' TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
   'created_at' DATETIME DEFAULT NULL,
   PRIMARY KEY(id)
  );

#1064 - 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 ''id' int UNSIGNED AUTO INCREMENT, 'title' VARCHAR(100), 'content' VARCHAR(5000' at line 2

Dharman
  • 30,962
  • 25
  • 85
  • 135
Isuru
  • 3,818
  • 13
  • 49
  • 64
  • 1
    Does this answer your question? [When to use single quotes, double quotes, and backticks in MySQL](https://stackoverflow.com/questions/11321491/when-to-use-single-quotes-double-quotes-and-backticks-in-mysql) – Dharman Jul 03 '21 at 16:38

1 Answers1

3

Field names need to be wrapped in backtics - quotes will cause an error.

So,

`id` int UNSIGNED AUTO_INCREMENT,
`title` VARCHAR(100),

etc.

Pekka
  • 442,112
  • 142
  • 972
  • 1,088