0

Hi!,

Need a little help... thanks in advance!!!!

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/exponentialprofi/public_html/affiliates/topreferrals.php on line 22

 (code in question)   
    <?php

    $dsplynumreftop="5";

    $qryreftop = "SELECT usrnam, (usrpoints + usrpointsindirect) AS maxpoints FROM scraffiliateusr ORDER BY maxpoints desc";
    $rslreftop=mysql_query($qryreftop);
    //$arrreftop =  mysql_fetch_row($rslreftop);
    $nreftop = mysql_num_rows($rslreftop);

    for ($i=0; $i<$dsplynumreftop; $i++)
    {
    $arrreftop =  mysql_fetch_row($rslreftop);  <<<<<<<<<<<<<<<<<<< Line 22

    echo "$arrreftop[0]<br>";
    }
    ?>

Thanks,
duchaine

4
Contributors
3
Replies
22
Views
2 Years
Discussion Span
Last Post by rubberman
0

You should use mysqli or pdo. Also you're not opening the connection

Edited by Jorge_7: Typo

0

To extend Jorge_7's answer - you're not opening the connection to the database. As noted, the mysql api's are deprecated (out of date) so either use pdo or mysqli. Myself I prefer mysqli for MySQL database connections, though I think that PDO is more general and supports other databases as well.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.