Jump to content

MySQL - Erro


Recommended Posts

estou a criar uma tabela com uma chave secundaria mas está a dar este erro,

Mensagens do MySQL :

#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 'REFERENCES servico(id_servico))' at line 7

create table produtos_1

( id_produto int not null primary key auto_increment,

nome_produto varchar(30) not null,

imagem blob not null,

quantidade int ,

id_servico int not null,

foreign key id_servico REFERENCES servico(id_servico))

obrigado :-S

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.