...

View Full Version : Resolved Help to fix errors



inta74
11-20-2010, 10:01 PM
Hello CF's

i would be really grateful if someone could help me fix the errors
in a script i have

errors im getting after install



Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/admin_dealer/dhdealer.co.cc/index.php on line 42

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/admin_dealer/dhdealer.co.cc/index.php on line 45

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/admin_dealer/dhdealer.co.cc/index.php on line 48


File where the errors are occurring


#
<?
#
$sql = "select count(*) from moneymembers where active=1";
#
$result = mysql_query($sql);
#
$rs = mysql_fetch_row($result);
#
$sql2 = "select sum(DAmount) from moneypool where approved=1";
#
$result2 = mysql_query($sql2);
#
$rs2 = mysql_fetch_row($result2);
#
$sql6 = "select sum(Amount) from wtransaction where approved=1";
#
$result6 = mysql_query($sql6);
#
$rs6 = mysql_fetch_row($result6);
#
?>
*Lines 39 - 49


Thank you

MattF
11-20-2010, 10:16 PM
$rs = ((mysql_num_rows($result)) ? mysql_fetch_row($result) : '');


Same applies to the other lines.

inta74
11-20-2010, 10:28 PM
hello and thanks,
i edited the code but the errors still seems to be there



#
<?
#
$sql = "select count(*) from moneymembers where active=1";
#
$result = mysql_query($sql);
#
$rs = ((mysql_num_rows($result)) ? mysql_fetch_row($result) : '');
#
$sql2 = "select sum(DAmount) from moneypool where approved=1";
#
$result2 = mysql_query($sql2);
#
$rs2 = ((mysql_num_rows($result)) ? mysql_fetch_row($result2) : '');
#
$sql6 = "select sum(Amount) from wtransaction where approved=1";
#
$result6 = mysql_query($sql6);
#
$rs6 = ((mysql_num_rows($result)) ? mysql_fetch_row($result6) : '');
#
?>
and is this correct?

MattF
11-20-2010, 10:32 PM
<?php
#
$sql = "select count(*) from moneymembers where active=1";
#
$result = mysql_query($sql) or exit(mysql_error());
#
$rs = ((mysql_num_rows($result)) ? mysql_fetch_row($result) : '');
#
$sql2 = "select sum(DAmount) from moneypool where approved=1";
#
$result2 = mysql_query($sql2) or exit(mysql_error());
#
$rs2 = ((mysql_num_rows($result2)) ? mysql_fetch_row($result2) : '');
#
$sql6 = "select sum(Amount) from wtransaction where approved=1";
#
$result6 = mysql_query($sql6) or exit(mysql_error());
#
$rs6 = ((mysql_num_rows($result6)) ? mysql_fetch_row($result6) : '');
#
?>

inta74
11-20-2010, 10:39 PM
Thank you very much matt :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum