Ir para conteúdo

POWERED BY:

Arquivado

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

djanderson

Acontece esse Erro

Recommended Posts

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\Program Files (x86)\VertrigoServ\www\WEBSITE + NOTICIAS\website\home.php on line 31

 

esses são os códigos

 

<link href="css/style.css" rel="stylesheet" type="text/css" />

<div id="noticias-top"></div><!-- Aqui iniciamos o topo do background das notícias -->
<div id="geral-mid">
<!-- Sistema de Notícias do ike3da, todos créditos à ele -->
<?php
include('noticias/config/conexao.php'); ?>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<script language="JavaScript">
function abrir(URL) {
var width = 750;
var height = 400;
var left = 600;
var top = 350;
window.open(URL,'janela', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=yes, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
}
</script>
<style type="text/css">
a.link-news { margin-left: 15px; font:bold 14px arial, verdana, tahoma; letter-spacing:-1.1px; text-align:center; color:#000; text-decoration: none;}
a.link-news:visited { margin-left: 15px; font:bold 14px arial, verdana, tahoma; letter-spacing:-1.1px; text-align:center; color:#aaa; }
a.link-news:hover { argin-left: 15px; font:bold 14px arial, verdana, tahoma; letter-spacing:-1.1px; text-align:center; color:#ccc; }
a.vertodas { margin-top: 10px; text-decoration:none; font: bold 9px tahoma, arial; color:#6c538d; }
a.vertodas:hover { margin-top: 10px; text-decoration:none; font: bold 9px tahoma, arial; color:#464646; }
a.vertodas:visited { margin-top: 10px; text-decoration:none; font: bold 9px tahoma, arial; color:#4793b8; }
</style>
<?php //quando status = 'Sim'
$query_noticias = "select * from tbl_noticias where status = 'Sim' ORDER BY id_noticia DESC limit 10";
$rs_noticias = mysql_query($query_noticias);
while($campo_noticias = mysql_fetch_array($rs_noticias)){
$id_noticia = $campo_noticias['id_noticia'];
$data_noticia = $campo_noticias['data'];
$descricao_noticia = $campo_noticias['descricao'];
$titulo_noticia = $campo_noticias['titulo'];
?>
<div style="text-align: left;">
<div style="height:7px;"></div>
<span style="margin-left: 10px; font:bold 12px arial, verdana, tahoma; letter-spacing:-1.1px; color:#2586f2; "><?php echo $data_noticia;?></span> <A class="link-news" title='<?php echo $descricao_noticia; ?>' href="javascript:abrir('noticias-descricao.php?id_noticia=<?php echo $id_noticia; ?>');"> <?php echo $titulo_noticia; ?></A><br>
</div>
<?php } ?>
</div><!-- Aqui fazemos com que o background se repita para sempre, sem a ncessidade de um limite de notícias -->
<div id="geral-fim"></div>
se alguém poder ajudar

Compartilhar este post


Link para o post
Compartilhar em outros sites

Sua consulta tem algum erro, use:

$rs_noticias = mysql_query($query_noticias)OR DIE(mysql_error());

Para exibir o problema.

Compartilhar este post


Link para o post
Compartilhar em outros sites

vou manda a tabela que esta aqui

 

-- Versão do PHP: 5.2.6
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Banco de Dados: `undermin_db`
--
-- --------------------------------------------------------
--
-- Estrutura da tabela `tbl_noticias`
--
CREATE TABLE IF NOT EXISTS `tbl_noticias` (
`id_noticia` int(11) NOT NULL AUTO_INCREMENT,
`titulo` varchar(70) NOT NULL,
`descricao` varchar(100) NOT NULL DEFAULT '',
`destaque` char(3) NOT NULL DEFAULT '',
`autor` varchar(55) NOT NULL DEFAULT '',
`msg` text NOT NULL,
`nome_arquivo` varchar(100) NOT NULL DEFAULT '',
`data` varchar(15) NOT NULL DEFAULT '',
`status` varchar(10) NOT NULL,
PRIMARY KEY (`id_noticia`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=72 ;
--
-- Extraindo dados da tabela `tbl_noticias`
--
INSERT INTO `tbl_noticias` (`id_noticia`, `titulo`, `descricao`, `destaque`, `autor`, `msg`, `nome_arquivo`, `data`, `status`) VALUES
(1, 'Inauguração do Sistema de Notícias', 'Distruibuido Gratuitamente por ike3da', '', 'ike3da', 'Obrigado por utilizar este script feito por mim.<br><br>MSN para contato: ike3da@hotmail.com<br>Abraços!', 'ike3da.png', '14/11/2011', 'Sim'),
(60, 'Notícia inativa', '', '', 'ike3da', 'Esta notícia não é exibida na index do site por estar marcada como "Não ativa" no campo abaixo.<br><br>Favor deletar esta notícia.<br><br>', '', '14/11/2011', 'Não');
-- --------------------------------------------------------
--
-- Estrutura da tabela `tbl_usuarios`
--
CREATE TABLE IF NOT EXISTS `tbl_usuarios` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`nome` varchar(150) NOT NULL DEFAULT '',
`login` varchar(150) NOT NULL DEFAULT '',
`senha` varchar(50) NOT NULL DEFAULT '',
`status` varchar(10) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
--
-- Extraindo dados da tabela `tbl_usuarios`
--
INSERT INTO `tbl_usuarios` (`id`, `nome`, `login`, `senha`, `status`) VALUES
(1, 'SEUNOME', 'admin', 'admin', '1');
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

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.