Scusatemi sono molto Noob!!![]()
Volevo adattare uno script per le news al mio sito, ma mi sono bloccato a questo punto e cioè Warning: mysql_num_rows():
Il fatto strano è che lo fà anche con il file originale in rete, mentre in locale è tutto funzionate.
Lo script:
<HTML>
<?
require("connect.php"); //Including the language.inc
require($lang); //Including the config_style.inc which gives extra config oportunity require($style); ?> <HEAD> <title><? echo $headtitle; ?></title> <? // Using CSS echo'<LINK rel="stylesheet" href="'.$css.'">'; ?> </HEAD> <body bgcolor=<? echo($bodycolor); ?>> <?php //Connecting to Database and reading number of entries $result = @mysql_query ("select * from $table_news order by news_date DESC"); $num = @mysql_num_rows($result); // Starting the Output-List ?> <table border="1" cellpadding="0" cellspacing="1" width="500" align="center"> <?PHP while($i < $num) { echo '<TR><TD valign="middle" align="left" width="6"><FONT size="'.$preview_news_text_fontsize.'" face="'.$output_fontface.'">[img]'.$path_tag_pic.'[/img]'; echo '</FONT></TD><TD valign="middle" align="left" width="70"><FONT size="'.$preview_news_text_fontsize.'" face="'.$output_fontface.'">'; echo mysql_result($result,$i,"news_day"); echo "-"; echo mysql_result($result,$i,"news_month"); echo "-"; echo mysql_result($result,$i,"news_year"); echo "</FONT></TD>"; echo '<TD valign="middle" align="left" width="420"><FONT size="'.$preview_news_text_fontsize.'" face="'.$output_fontface.'"><A HREF=show_news.php?uid='; echo mysql_result($result,$i,"uid"); echo ">"; echo mysql_result($result,$i,"news_title"); echo '</A> </FONT><FONT size="'.$hits_fontsize.'" face="'.$hits_fontface.'">('; echo mysql_result($result,$i,"news_hits"); echo " Hits)"; echo "</FONT></TD></TR><TR></TR>"; $i++; }; ?> </TABLE>
</body> </HTML>
Siceramente nn so il motivo di questo errore, help me!