Jump to content
Fórum Script Brasil
  • 0

(Resolvido) Ajudem Sistema de noticias


Dexvil

Question

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 to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 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 to comment
Share on other 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 to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652k
×
×
  • Create New...