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

Recommended Answers

All 3 Replies

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.