taudujas Posted July 2, 2004 Report Share Posted July 2, 2004 Aparece a seguinte mensagem:Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/drogadal/public_html/dicas/pagina.php on line 8O codigo é: busca.php<html><head><title>Documento sem título</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head><body><form name="form1" method="post" action="pagina.php"> <table width="75%" border="0"> <tr> <td width="39%"><div align="right"><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Busca:</font></strong></div></td> <td width="61%"><input name="busca" type="text" id="busca"> <input type="submit" name="Submit" value="Enviar"></td> </tr> </table></form></body></html>pagina.php<?include "config.php";$busca = $_POST["busca"];//pega os dados digitados no formulario// seleciona os dados do banco $query = mysql_query("SELECT * FROM pna_artigos WHERE artigo like '%busca%'");$contagem = mysql_num_rows($query);// verifica os numeros de linhasif ($contagem == 0) //se for igual a zero {echo "<center><font color = \"#0000FF\">Não Achou Nenhum Registro</font></center><a href=\"javascript:history.go(-1)\"><center>Voltar</center></a>";exit();}else{//enquanto pega o arraywhile ($coluna = mysql_fetch_array($query)){$artigo = $coluna["artigo"];echo $artigo;}}?> Quote Link to comment Share on other sites More sharing options...
0 Error404 Posted July 2, 2004 Report Share Posted July 2, 2004 Dá um:echo "erro: ".mysql_error(); no final de tudo... Então passa pra gente o resultado Quote Link to comment Share on other sites More sharing options...
0 Fabyo Posted July 2, 2004 Report Share Posted July 2, 2004 Geralmente esse erro é quando você digitou algo errado na sintase sqlalgum campo ou nome com algum erro Quote Link to comment Share on other sites More sharing options...
0 taudujas Posted July 2, 2004 Author Report Share Posted July 2, 2004 ixi Fabyo, já conferi e esta tudo certinho os campos e a tabela.. Quote Link to comment Share on other sites More sharing options...
0 taudujas Posted July 2, 2004 Author Report Share Posted July 2, 2004 Error, com este comando ai não retornou nada de erro não, somente o erro anterior mesmo.Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/drogadal/public_html/dicas/pagina.php on line 8 Quote Link to comment Share on other sites More sharing options...
0 Fabyo Posted July 2, 2004 Report Share Posted July 2, 2004 Certeza?pois eu peguei seu script e testei aqui e funcionoué claro que eu modifiquei só o meu banco ,mas nada diferente Quote Link to comment Share on other sites More sharing options...
0 taudujas Posted July 2, 2004 Author Report Share Posted July 2, 2004 Beleza, vou reaver aqui, obrigado.. Quote Link to comment Share on other sites More sharing options...
Question
taudujas
Aparece a seguinte mensagem:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/drogadal/public_html/dicas/pagina.php on line 8
O codigo é: busca.php
pagina.php
Link to comment
Share on other sites
6 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.