tags:

views:

63

answers:

4

I recently bought a ptc script and I am getting the following errors on my site alphabux.com:

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in
         /home/alphabux/public_html/sitestats.php on line 4

Warning: mysql_result(): supplied argument is not a valid MySQL result resource in 
        /home/alphabux/public_html/sitestats.php on line 9

Warning: mysql_result(): supplied argument is not a valid MySQL result resource in
        /home/alphabux/public_html/sitestats.php on line 20
Per click:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource 
         in /home/alphabux/public_html/sitestats.php on line 29
$
Premium click: 0.02 $
Minimum payout:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource 
         in /home/alphabux/public_html/sitestats.php on line 41

For your convience I've uploaded the php file as html here: www.alphabux.com/sitestats.htm

I'm also getting these 2 errors:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource 
         in /home/alphabux/public_html/index.php on line 165

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource
         in /home/alphabux/public_html/index.php on line 170

Here are line 165 and 170:

$myrowzdu = mysql_fetch_array($resultzdu);

$myrowzduz = mysql_fetch_array($resultzduz);

How do I fix these errors?

A: 

Make sure that the MySQL connection is succeeding, and make sure the MySQL query is succeeding.

Check mysql_error() after executing a query.

Charlie Somerville
+1  A: 

You need to examine $resultzdu and $resultzduz. But you shouldn't bother unless you are a programmer. Since you "bought" this "ptc script", you should have bought some suport to go with it :)

A: 

could you show your connect script?

An example from php.net

$link = mysql_connect("localhost", "mysql_user", "mysql_password"); mysql_select_db("database", $link);

$result = mysql_query("SELECT * FROM table1", $link); $num_rows = mysql_num_rows($result);

echo "$num_rows Rows\n";

The Disintegrator
A: 

You are quite often "including" the file config.php in your script. Does this script actually open a database connection? Why you close the mysql connection after each block and is there anything in config.php that could prevent the database to be opened a second time? One more thing I don't understand, why you use "mysql_close($con);"? Have you set $con anywhere?

merkuro