ERRO MYSQL NA CRIAÇÃO DA TABELA

29/04/2018

0

Boa tarde

estou tentando criar esse sistema:
https://www.devmedia.com.br/sistema-de-autenticacao-de-usuarios-em-php-usando-sessoes-e-mysql/37258

só que na hora de tentar criar a tabela do bando da erro:

CREATE TABLE ''''aut_noticias'''' (
''''id'''' int(11) NOT NULL auto_increment,
''''titulo'''' varchar(255) NOT NULL defalut '''''''',
''''conteudo'''' text NOT NULL,
''''autor_id" int (11) NOT NULL default ''''0'''',
''''data'''' int (11) NOT NULL default ''''0'''',
PRIMARY KEY (''''id'''')
) TYPE=My ISAM AUTO_INCREMENT=4;


vi que tinha alguns erros então coloquei assim:

CREATE TABLE aut_noticias (
id int(11) NOT NULL auto_increment PRIMARY KEY,
titulo varchar(255) NOT NULL default '''''''',
conteudo text NOT NULL,
autor_id int (11) NOT NULL default ''''0'''',
data int (11) NOT NULL default ''''0''''
) TYPE=My ISAM AUTO_INCREMENT=4;


mas mesmo assim esta dando erro...
Comando SQL:


CREATE TABLE aut_noticias (
id int(11) NOT NULL auto_increment PRIMARY KEY,
titulo varchar(255) NOT NULL default '''''''',
conteudo text NOT NULL,
autor_id int (11) NOT NULL default ''''0'''',
data int (11) NOT NULL default ''''0''''
) TYPE=My ISAM AUTO_INCREMENT=4
Mensagens do MySQL : Documentação

#1064 - Você tem um erro de sintaxe no seu SQL próximo a ''''TYPE=My ISAM AUTO_INCREMENT=4'''' na linha 7


alguém pode me ajudar?
Richard Lopes

Richard Lopes

Responder

Post mais votado

30/04/2018

Simplesmente substitua Type por Engine, que acredito que irá resolver.

CREATE TABLE aut_noticias (
...
) ENGINE=MyISAM;

Infogen Ltda

Infogen Ltda
Responder

Mais Posts

30/04/2018

Richard Lopes

Obrigadooooooooo
funcionou direitinho :)
Responder

APRENDA A PROGRAMAR DO ZERO AO PROFISSIONAL

Assitir aula

Saiba por que programar é uma questão de
sobrevivência e como aprender sem riscos

Assistir agora

Utilizamos cookies para fornecer uma melhor experiência para nossos usuários, consulte nossa política de privacidade.

Aceitar