0

I have an issue when creating a new table.

Here is my query:

CREATE TABLE 'pendaftar' (
    'id' int(10) NOT NULL   AUTO_INCREMENT,
    'tgl' DATE NOT NULL,
    'nopol' VARCHAR (10) NOT NULL,
    'motor' VARCHAR (50) NOT NULL,
    'servis' VARCHAR (50) NOT NULL,
    'keluhan' LONGTEXT NOT NULL
    PRIMARY KEY (id));

The error message I receive is:

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 ''pendaftar' ('id' int(10) NOT NULL AUTO_INCREMENT,'tgl' DATE NOT NUL' at line 1

Please help me fix this issue.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Realalun
  • 35
  • 1
  • 2
  • 7
  • 1
    don't use quotes to escape table or column names. Remove them or use backticks instead – juergen d Apr 29 '18 at 04:49
  • Welcome to SO. Please check [When to use single quotes, double quotes, and back ticks in MySQL](http://stackoverflow.com/questions/11321491/when-to-use-single-quotes-double-quotes-and-backticks#11321508) – Lukasz Szozda Apr 29 '18 at 04:52
  • my bad.. i use quote instead of bactick. Thanks for the answer, very appriciate it – Realalun Apr 29 '18 at 05:09

0 Answers0