ID: 13314
Updated by: swm
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: MySQL related
Operating System: Red Hat Linux 7.1
PHP Version: 4.0.6
New Comment:

Are you connecting to the MySQL database before you execute
your query?

Previous Comments:
------------------------------------------------------------------------

[2001-09-15 04:53:58] [EMAIL PROTECTED]

Background:  I am running RH7.1 with MySQL 3.23, PHP-Nuke 5.0, and phpBB 1.4.1 (both 
Nuke and the BB are using the same database).  After reading through ticket number 
10368, I removed PHP4.0.4, and compiled 4.0.6 using --with-mysql=/usr/ --with-apxs

I continue to get the following error:
Warning: Supplied argument is not a valid MySQL result resource.

The code that produces this error is this:
function cookiedecode($user) {
    global $cookie, $prefix;
    $user = base64_decode($user);
    $cookie = explode(":", $user);
    $result = mysql_query("select pass from $prefix"._users." where 
uname='$cookie[1]'");
     list($pass)= mysql_fetch_row($result);
    if ($cookie[2] == $pass && $pass != "") {
        return $cookie;
    } else {
        unset($user);
        unset($cookie);
    }
}

I have determined that everything works up until the mysql_fetch_row function.  i did 
this by inserting 
die($result) on the line prior to mysql_fetch_row.
The resulting output is this: Resource id #2
I have been able to run the query inside mysql, and went so far as to have php die at 
the $cookie[1] and $cookie[2], just to verify that it was looking at the right 
information.

Any ideas or suggestions as far as this is concerned would be a great help.

Thank you,


--
Rex

------------------------------------------------------------------------



Edit this bug report at http://bugs.php.net/?id=13314&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to