-1

I was following a tutorial for Laravel and this course required me to use TablePlus. I had to create a table with a given query, but it's not working and I am not completely sure as to why it's not working.

Here is the query I am using

CREATE TABLE users {
    `id` INT NOT NULL AUTO_INCREMENT,
    `name` VARCHAR(100) NOT NULL,
    `email` VARCHAR(100) NOT NULL,
    PRIMARY KEY (id) 
};

In the tutorial I am following "Auto_Increment" is highlighted blue, but with me it's just the standard white.

And this is the error I receive when I try to run this query.

Query 1: 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 NOT NULL AUTO_INCREMENT,
    `name` VARCHAR(100) NOT NULL,
    `email` VAR' at line 1

I would appreciate it if someone could tell me why this is happening as it is something that Google doesn't have answer to.

0

1 Answer 1

1

I think you are making an error using {} TRY:

CREATE TABLE users (
    `id` INT NOT NULL AUTO_INCREMENT,
    `name` VARCHAR(100) NOT NULL,
    `email` VARCHAR(100) NOT NULL,
    PRIMARY KEY (id) 
);

Or is it because of laravel? I am not sure about laravel

1
  • 1
    I completely missed that. Thank you! Commented Aug 23, 2022 at 11:39

Not the answer you're looking for? Browse other questions tagged or ask your own question.