Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

brunobrobr

Banco de dados MySQL

Recommended Posts

OLA BOM DIA PESSOAL , BOM ESTOU COM UM PROBLEMA ESTOU TENTANDO CRIAR 2 TABELA NO MySQL MAIS NÃO ESTA DANDO CERTO , O MySQL ESTA FALANDO QUE A VERSAO NAO CORRESPONDE AO CODIGO DA TABELA , MAIS A VERSAO DO MEU MySQL E A ULTIMA VERSÃO , VOU COLOCAR O CODIGO DAS DUAS TABELAS E SE VOCÊS PODEREM ME AJUDAR A MUDAR ALGUMA COISA NO CODIGO PARA QUE ELE POSSA PEGAR NO MEU BANCO DE DADOS FICAREI GRATO....OBG

 

 

 

---------- CRIA A TABELA DE CATEGORIA DE NOTÍCIAS ----------

CREATE TABLE `tbl_categorias_noticias` (
  `id_categoria_noticia` tinyint(3) unsigned NOT NULL auto_increment,
  `categoria` varchar(50) default NULL,
  PRIMARY KEY  (`id_categoria_noticia`)
) TYPE=MyISAM ROW_FORMAT=DYNAMIC;

INSERT INTO `tbl_categorias_noticias` VALUES (2,'Teste 1');
INSERT INTO `tbl_categorias_noticias` VALUES (3,'Teste 2');

---------- CRIA A TABELA DE NOTÍCIAS ----------

CREATE TABLE `tbl_noticias` (
  `id_noticia` int(11) NOT NULL auto_increment,
  `id_categoria_noticia` tinyint(4) NOT NULL default '0',
  `titulo` varchar(100) NOT NULL default '',
  `descricao` varchar(255) NOT NULL default '',
  `destaque` char(3) NOT NULL default '',
  `fotografo` varchar(100) NOT NULL default '',
  `legenda` varchar(55) NOT NULL default '',
  `msg` text NOT NULL,
  `nome_arquivo` varchar(100) NOT NULL default '',
  `data` varchar(15) NOT NULL default '',
  `status` tinyint(3) NOT NULL default '0',
  PRIMARY KEY  (`id_noticia`)
) TYPE=MyISAM ROW_FORMAT=DYNAMIC;

INSERT INTO `tbl_noticias` VALUES (2,2,'Sistema de Notícias 01','Descrição do Sistema de Notícias','1','','Webmaster.PT','<p style=\"MARGIN-RIGHT: 0px\">Lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor.</p><p style=\"MARGIN-RIGHT: 0px\">Lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor.</p><p style=\"MARGIN-RIGHT: 0px\">Lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor.</p><p style=\"MARGIN-RIGHT: 0px\">Lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor.</p>','ad_orcamento.jpg','02/01/2010',1);
INSERT INTO `tbl_noticias` VALUES (3,2,'Lorem ipsum dolor','Lorem ipsum dolor lorem ipsum dolor','1','','Webmaster.PT','<p style=\"MARGIN-RIGHT: 0px\">Lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor.</p><p style=\"MARGIN-RIGHT: 0px\">Lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor.</p><p style=\"MARGIN-RIGHT: 0px\">Lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor.</p><p style=\"MARGIN-RIGHT: 0px\">Lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor.</p>','bg_woman_help.jpeg','02/01/2010',1);


---------- CRIA A TABELA DOS USUÁRIOS QUE FARÃO O ACESSO À ÁREA GERENCIAL ----------

CREATE TABLE `tbl_usuarios` (
  `id` int(11) NOT NULL auto_increment,
  `nome` varchar(150) NOT NULL default '',
  `email` varchar(150) NOT NULL default '',
  `senha` varchar(50) NOT NULL default '',
  `status` varchar(10) NOT NULL default '',
  PRIMARY KEY  (`id`)
) TYPE=MyISAM;

INSERT INTO `tbl_usuarios` VALUES (1,'Administrador','teste@teste.com','123456','1');

 

Compartilhar este post


Link para o post
Compartilhar em outros sites

Bruno, tente não escrever em uppercase, parece que você está gritando e isso pode lhe atrapalhar em receber ajuda.

Tente utilizar o seguinte código:

---------- CRIA A TABELA DE CATEGORIA DE NOTÍCIAS ----------

CREATE TABLE `tbl_categorias_noticias` (
  `id_categoria_noticia` tinyint(3) unsigned NOT NULL auto_increment,
  `categoria` varchar(50) default NULL,
  PRIMARY KEY  (`id_categoria_noticia`)
);

INSERT INTO `tbl_categorias_noticias` VALUES (2,'Teste 1');
INSERT INTO `tbl_categorias_noticias` VALUES (3,'Teste 2');

---------- CRIA A TABELA DE NOTÍCIAS ----------

CREATE TABLE `tbl_noticias` (
  `id_noticia` int(11) NOT NULL auto_increment,
  `id_categoria_noticia` tinyint(4) NOT NULL default '0',
  `titulo` varchar(100) NOT NULL default '',
  `descricao` varchar(255) NOT NULL default '',
  `destaque` char(3) NOT NULL default '',
  `fotografo` varchar(100) NOT NULL default '',
  `legenda` varchar(55) NOT NULL default '',
  `msg` text NOT NULL,
  `nome_arquivo` varchar(100) NOT NULL default '',
  `data` varchar(15) NOT NULL default '',
  `status` tinyint(3) NOT NULL default '0',
  PRIMARY KEY  (`id_noticia`)
);

INSERT INTO `tbl_noticias` VALUES (2,2,'Sistema de Notícias 01','Descrição do Sistema de Notícias','1','','Webmaster.PT','<p style=\"MARGIN-RIGHT: 0px\">Lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor.</p><p style=\"MARGIN-RIGHT: 0px\">Lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor.</p><p style=\"MARGIN-RIGHT: 0px\">Lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor.</p><p style=\"MARGIN-RIGHT: 0px\">Lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor.</p>','ad_orcamento.jpg','02/01/2010',1);
INSERT INTO `tbl_noticias` VALUES (3,2,'Lorem ipsum dolor','Lorem ipsum dolor lorem ipsum dolor','1','','Webmaster.PT','<p style=\"MARGIN-RIGHT: 0px\">Lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor.</p><p style=\"MARGIN-RIGHT: 0px\">Lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor.</p><p style=\"MARGIN-RIGHT: 0px\">Lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor.</p><p style=\"MARGIN-RIGHT: 0px\">Lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor.</p>','bg_woman_help.jpeg','02/01/2010',1);


---------- CRIA A TABELA DOS USUÁRIOS QUE FARÃO O ACESSO À ÁREA GERENCIAL ----------

CREATE TABLE `tbl_usuarios` (
  `id` int(11) NOT NULL auto_increment,
  `nome` varchar(150) NOT NULL default '',
  `email` varchar(150) NOT NULL default '',
  `senha` varchar(50) NOT NULL default '',
  `status` varchar(10) NOT NULL default '',
  PRIMARY KEY  (`id`)
);

INSERT INTO `tbl_usuarios` VALUES (1,'Administrador','teste@teste.com','123456','1');

Compartilhar este post


Link para o post
Compartilhar em outros sites

 

Bruno, tente não escrever em uppercase, parece que você está gritando e isso pode lhe atrapalhar em receber ajuda.

Tente utilizar o seguinte código:

---------- CRIA A TABELA DE CATEGORIA DE NOTÍCIAS ----------

CREATE TABLE `tbl_categorias_noticias` (
  `id_categoria_noticia` tinyint(3) unsigned NOT NULL auto_increment,
  `categoria` varchar(50) default NULL,
  PRIMARY KEY  (`id_categoria_noticia`)
);

INSERT INTO `tbl_categorias_noticias` VALUES (2,'Teste 1');
INSERT INTO `tbl_categorias_noticias` VALUES (3,'Teste 2');

---------- CRIA A TABELA DE NOTÍCIAS ----------

CREATE TABLE `tbl_noticias` (
  `id_noticia` int(11) NOT NULL auto_increment,
  `id_categoria_noticia` tinyint(4) NOT NULL default '0',
  `titulo` varchar(100) NOT NULL default '',
  `descricao` varchar(255) NOT NULL default '',
  `destaque` char(3) NOT NULL default '',
  `fotografo` varchar(100) NOT NULL default '',
  `legenda` varchar(55) NOT NULL default '',
  `msg` text NOT NULL,
  `nome_arquivo` varchar(100) NOT NULL default '',
  `data` varchar(15) NOT NULL default '',
  `status` tinyint(3) NOT NULL default '0',
  PRIMARY KEY  (`id_noticia`)
);

INSERT INTO `tbl_noticias` VALUES (2,2,'Sistema de Notícias 01','Descrição do Sistema de Notícias','1','','Webmaster.PT','<p style=\"MARGIN-RIGHT: 0px\">Lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor.</p><p style=\"MARGIN-RIGHT: 0px\">Lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor.</p><p style=\"MARGIN-RIGHT: 0px\">Lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor.</p><p style=\"MARGIN-RIGHT: 0px\">Lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor.</p>','ad_orcamento.jpg','02/01/2010',1);
INSERT INTO `tbl_noticias` VALUES (3,2,'Lorem ipsum dolor','Lorem ipsum dolor lorem ipsum dolor','1','','Webmaster.PT','<p style=\"MARGIN-RIGHT: 0px\">Lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor.</p><p style=\"MARGIN-RIGHT: 0px\">Lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor.</p><p style=\"MARGIN-RIGHT: 0px\">Lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor.</p><p style=\"MARGIN-RIGHT: 0px\">Lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor.</p>','bg_woman_help.jpeg','02/01/2010',1);


---------- CRIA A TABELA DOS USUÁRIOS QUE FARÃO O ACESSO À ÁREA GERENCIAL ----------

CREATE TABLE `tbl_usuarios` (
  `id` int(11) NOT NULL auto_increment,
  `nome` varchar(150) NOT NULL default '',
  `email` varchar(150) NOT NULL default '',
  `senha` varchar(50) NOT NULL default '',
  `status` varchar(10) NOT NULL default '',
  PRIMARY KEY  (`id`)
);

INSERT INTO `tbl_usuarios` VALUES (1,'Administrador','teste@teste.com','123456','1');

Cara Muitoo obrigado rs' ajudou bastante deu certo aqui 100% , tem skype ? abrçs..

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.