Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Galera, preciso de uma ajudinha de vcs...tenho as seguintes tabelas:
-- ---------------------------------------------------------- -- Estrutura da tabela comfestas-- CREATE TABLE comfestas ( cod int(11) NOT NULL auto_increment, codfesta int(11) NOT NULL default '0', datacom text NOT NULL, nome text NOT NULL, comentario longtext NOT NULL, PRIMARY KEY (cod)) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=201 ;-- ---------------------------------------------------------- -- Estrutura da tabela comfot-- CREATE TABLE comfot ( cod int(11) NOT NULL auto_increment, codfesta int(11) NOT NULL default '0', codfotografo int(11) NOT NULL default '0', fotofotografo varchar(100) NOT NULL default '', comentario text NOT NULL, PRIMARY KEY (cod)) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;-- ---------------------------------------------------------- -- Estrutura da tabela festas-- CREATE TABLE festas ( cod int(11) NOT NULL auto_increment, nome text NOT NULL, local text NOT NULL, data text NOT NULL, dir text NOT NULL, fotografo text NOT NULL, cidade text NOT NULL, dircidade text NOT NULL, cad text NOT NULL, agenda int(11) NOT NULL default '0', permitecom char(1) NOT NULL default '', PRIMARY KEY (cod)) ENGINE=MyISAM DEFAULT CHARSET=latin1 PACK_KEYS=0 AUTO_INCREMENT=379 ;-- ---------------------------------------------------------- -- Estrutura da tabela fotos-- CREATE TABLE fotos ( cod int(11) NOT NULL auto_increment, codfesta int(11) NOT NULL default '0', cliques int(11) NOT NULL default '0', foto text NOT NULL, votosp int(11) NOT NULL default '0', votosn int(11) NOT NULL default '0', permitecom char(1) NOT NULL default '', PRIMARY KEY (cod)) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=24808 ;
Eu quero fazer uma consulta onde me retorna todos os dados da tabela Festas + : O numero de fotos que essa festa tem (tabela fotos) O numero de comentarios de fotografos (tabela comfot)* O numero de comentarios da festa (tabela comfestas)Alguem por favor me ajuda...
Carregando comentários...