[sork] sql password change

Ilya mail@krel.org
Mon, 22 Jul 2002 20:41:03 -0400


Hi guys, I am one step from completing sql.php module for passwd, It looks like
the only problem I have left is this error:

[22-Jul-2002 20:14:46] PHP Fatal error:  Call to a member function on a
non-object in /usr/local/www/hord/passwd/lib/Driver/sql.php on line 188

this is the part of code where it happens:

if ($this->lookup($user, $oldPassword)) {
        // now that we know that user exist and old password is correct, change
the password
         /* Build the SQL query. */
        $query = 'UPDATE ' . $this->params['table'];
        $query .= ' set password = ' . $this->db->quote(md5($newPassword));
        $query .= ' WHERE user = ' . "'$user'";

        /* Execute the query. */
        $result = $this->db->query($query);

        if (!DB::isError($result)) {
            $row = $result->fetchRow(DB_GETMODE_ASSOC);   // <<<<<<<<< line 188
            if (is_array($row)) {
                $result->free();
                return true;
            } else {
                $result->free();
                return false;
            }
        } else {
            return false;
        }

         return true;
      }

      return false;
    }

the password is being checked and changed correctly, i am stuck here right now.

any suggestions? I can find this query() function to understand what it returns,
and why result is a non-object


thanks in advance.