Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Aug 2010
    Posts
    18
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Question Help to fix errors

    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
    PHP Code:

    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
    PHP Code:
    #
    <?
    #
    $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
    Last edited by inta74; 11-20-2010 at 10:39 PM.

  • #2
    Senior Coder
    Join Date
    Jul 2009
    Location
    South Yorkshire, England
    Posts
    2,318
    Thanks
    6
    Thanked 304 Times in 303 Posts
    Code:
    $rs = ((mysql_num_rows($result)) ? mysql_fetch_row($result) : '');
    Same applies to the other lines.

  • #3
    New Coder
    Join Date
    Aug 2010
    Posts
    18
    Thanks
    1
    Thanked 0 Times in 0 Posts
    hello and thanks,
    i edited the code but the errors still seems to be there

    PHP Code:
    #
    <?
    #
    $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?

  • #4
    Senior Coder
    Join Date
    Jul 2009
    Location
    South Yorkshire, England
    Posts
    2,318
    Thanks
    6
    Thanked 304 Times in 303 Posts
    Code:
    <?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) : '');
    #
    ?>
    Last edited by MattF; 11-20-2010 at 11:08 PM.

  • Users who have thanked MattF for this post:

    inta74 (11-20-2010)

  • #5
    New Coder
    Join Date
    Aug 2010
    Posts
    18
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thank you very much matt


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •