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)   


    $qryreftop = "SELECT usrnam, (usrpoints + usrpointsindirect) AS maxpoints FROM scraffiliateusr ORDER BY maxpoints desc";
    //$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>";


Please read the manual for reference Click Here

It will be remove soon so stop using mysql_* This extension is deprecated

please use PDO or MySQLi

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

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.