Hey Guys

Can anyone help me. On my website i receive this message

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /usr/local/psa/home/vhosts/mangofitness.net/httpdocs/developments/includes/mysql.inc.php on line 26

The coding for this file is below, can anyone help me get no errors.

<?
    require_once("config.php");

    function db_connect()
    {
        mysql_connect(DATABASE_SERVER,DATABASE_USER,DATABASE_PASSWORD)
            or die("Connection error: ".mysql_error());
        mysql_select_db(DATABASE_NAME)
            or die("Database not found: ".mysql_error());
        return 0;
    }
    function db_close()
    {
        mysql_close();
    }
    function db_query($query)
    {
        $result = mysql_query($query); 
        return $result;
    }
    function db_getrows($resource)
    {
        $data = array();
        $sql="select * from escrow_user where user='$user' and pass='$pass' LIMIT 1";  
        {
            while ($row = mysql_fetch_assoc($resource))
                $data[] = $row;
            return $data;
        }
            return array();
    }
?>

Thanks, would be much appreciated.

Jack

It means that you didn't open your DB correctly. I can't tell you exactly as you haven't posted the code which calls the function db_getrows(). Have a look there and make sure that the handle you're passing the function s correct.

It means that you didn't open your DB correctly. I can't tell you exactly as you haven't posted the code which calls the function db_getrows(). Have a look there and make sure that the handle you're passing the function s correct.

Hi, Thanks for that. Would it be possible for you to fix this issue for me, if i had access to your email address.

Thanks

Jack

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.