Hey i made this code to read cnstats information for me.
Here it is:
Code:
<?php
mysql_connect("localhost", "main_cnstats", "") or die(mysql_error());
mysql_select_db("") or die(mysql_error());
$result = mysql_query("SELECT hits,hosts FROM cns_counter")
or die(mysql_error());
while($row = mysql_fetch_array( $result )) {
// Print out the contents of each row
echo "<b>Todays Visitors:</b> ".$row['hosts']. "<br><b>Todays Hits:</b> ".$row['hits']. "<br>";
}
?>
But when i put it in on my website, when i go to look at the games on my website i get the error:
Code:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/main/public_html/v2/includes/browse.php on line 64
This is like 64 of browse.php and a line above and bellow it:
Code:
$numresults = mysql_query($sql_query); // the query.
$numrows = mysql_num_rows($numresults); // Number of rows returned from above query.
if ($numrows == 0){
__________________
Please login or register to view this content. Registration is FREE
NuWeb 10101101
Last edited by NuWeb.co.uk; 09-04-2005 at 10:01 AM..
|