I am encountering an error when trying to create a table in my database in MySql.
I read about this error in other occurrences here in the stackoverflow, and it seems that it occurs when you try to use a MySQL keyword where it should not be used, but I do not think this is occurring in my code.
Code:
CREATE TABLE tbl_vendas (
'id' INT UNSIGNED NOT NULL,
'id_produto' INT UNSIGNED NOT NULL,
'id_usuario' INT UNSIGNED NOT NULL,
'email_usuario' VARCHAR(50) NOT NULL,
'data_compra' DATE DEFAULT CURRENT_DATE,
PRIMARY KEY ('id'),
FOREIGN KEY ('id_produto') REFERENCES tbl_produtos('id'),
FOREIGN KEY ('id_usuario') REFERENCES tbl_usuario('id')
) ENGINE=INNODB;
Error:
# 1064 - You have a syntax error in your SQL next to 'CURRENT_DATE,
PRIMARY KEY (
id
),FOREIGN KEY (
id_produto
) REFERENCE 'on line 6