Ir para conteúdo
Fórum Script Brasil
  • 0

(Resolvido) Ajudem Sistema de noticias


Dexvil

Pergunta

Ola pessoal!!

Eu fiz um sistema de noticias onde no inicio ele printava normalmente mas quando eu o atualizo ele da

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in

Esse e o codigo da pagina de noticas

<! ----- Cdigo Noticia ----->

<TABLE cellSpacing=0 cellPadding=0 border=0>
  <TBODY>
  <TR>

<! ----- Barra news ----->

    <TD>
    <?
       if ($cont ==1) {
        $catimage = "titlebar_news.gif";
       } else {
        $catimage = "titlebar_community.gif";
       }
       printf("<IMG height=26 src='images/$catimage' width=394 useMap=#news border=0> ");
    ?>
    </TD>
  </TR>

  <TR>
    <TD style="PADDING-TOP: 3px">
      <TABLE style="MARGIN-BOTTOM: 6px" cellSpacing=0 cellPadding=0 border=0>
        <TBODY>
        <TR>
          <TD style="PADDING-LEFT: 5px" vAlign=top>
            <DIV style="WIDTH: 40px; POSITION: relative">


<? while ($linha = mysql_fetch_array($ver)){ ?>

<! ----- Imagem categoria ----->
   <TR>
    <TD style="PADDING-TOP: 3px">
      <TABLE style="MARGIN-BOTTOM: 6px" cellSpacing=0 cellPadding=0 border=0>
        <TBODY>
        <TR>
          <TD style="PADDING-LEFT: 5px" vAlign=top>
            <DIV style="WIDTH: 40px; POSITION: relative">
            <DIV style="POSITION: absolute">
        <? echo("<A onfocus=this.blur(); href=' $linha[2] ' target='newwindow'><IMG alt=' $linha[1] ' src='images/$linha[4]' border=0><BR><IMG height=1 src='images/p.gif' width=40 border=0></A>"); ?>
        </DIV>
        </DIV>
      </TD>
          <TD vAlign=top><IMG height=1 src="images/p.gif" width=5 border=0></TD>
          <TD>
            <TABLE cellSpacing=0 cellPadding=0 width=323 border=0>
              <TBODY>
              <TR>

<! ----- Imagem ponto noticia ----->

                <TD width=15>
        <IMG height=15 src="images/bullet.gif" width=15 border=0>
        </TD>

<! ----- Titulo noticia ----->

        <TD>
                    <? echo("<FONT class=tit><A href=' $linha[2] ' target='newwindow' onfoucs='this.blur();'> $linha[1] </A></FONT>"); ?>

        </TD>
          </TR>
              <TR>
                <TD></TD>
                
<! -- /--- Corpo noticia ----->

        <TD style="BORDER-BOTTOM: #b3a471 1px solid">
        
        <? echo("<A href=' $linha[2] ' target='newwindow' onfoucs='this.blur();'> $linha[3]  [<I>mais</I>]</A>"); ?>
        
        </TD>
          </TR>
          </TBODY>
        </TABLE>
      </TD>
    </TR>
    </TBODY>
      </TABLE>

<! ----- Fim noticia ----->

<? } } ?>[b][/b]
E essa e a DB
CREATE TABLE `wow_news` (
  `id` tinyint(4) NOT NULL auto_increment,
  `categoria` varchar(2) NOT NULL default '',
  `titulo` longtext NOT NULL,
  `link` longtext NOT NULL,
  `noticia` longtext NOT NULL,
  `imagem` varchar(50) NOT NULL default 'p.gif',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM;

Me ajudem por favor !!!

Link para o comentário
Compartilhar em outros sites

8 respostass a esta questão

Posts Recomendados

  • 0

mas com o <? while ($linha = mysql_fetch_array($ver)){ ?> ele exibe so q fica dando

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in constantemente e quando eu ponho ele no host ele n da erro mas pra exibir o conteudo tem q atualizar a pagina varias vezes

Link para o comentário
Compartilhar em outros sites

  • 0

Falta a consulta ao banco de dados que deve ser algo:

$ver = mysql_query...

Sem isto seu script não vai funcionar mesmo.

Vou te passar um exemplo de consulta que vai pegar todos os resultados:

....
<? 

$ver = mysql_query("SELECT * FROM wow_news")or die(mysql_error());

while ($linha = mysql_fetch_array($ver)){ ?>

...

Link para o comentário
Compartilhar em outros sites

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,2k
    • Posts
      652k
×
×
  • Criar Novo...