Session2.php error

Help
young999
2010-07-07
2013-04-24
  • young999
    young999
    2010-07-07

    Please Help me..
    I install phpmylibrary in AppServ when install complete phpmylibrary show message  "Fatal error: Call to a member function Execute() on a non-object in C:\AppServ\www\PhpMyLibrary\polerio\lib\Session2.php on line 378"
    How To fix error it
    Thank….

     

  • Anonymous
    2011-01-12

    Hello, finally i correct this.
    Edit function SessionWrite($sessid, $vars) IN 'polerio/lib/Session2.php' adding after

    list($pmldbconn) = Polerio::DBGetConn();

    this code:

        if (!is_object($pmldbconn)) {
            Polerio::DBInit();
            list($pmldbconn) = Polerio::DBGetConn();
        }

    My function looks like this:

    function SessionWrite($sessid, $vars)
    {
            if (!isset($sessid) || !isset($vars)) {
                    return false;
            }
        list($pmldbconn) = Polerio::DBGetConn();
        if (!is_object($pmldbconn)) {
            Polerio::DBInit();
            list($pmldbconn) = Polerio::DBGetConn();
        }
        $table = Polerio::DBGetTables();
        $sessioninfocolumn = &$table['session_info_column'];
        $sessioninfotable = $table['session_info'];
        $query = "UPDATE $sessioninfotable
                  SET $sessioninfocolumn[vars] = '" . Polerio::VarPrepForStore($vars) . "',
                      $sessioninfocolumn[lastused] = " . time() . "
                  WHERE $sessioninfocolumn[sessid] = '" . Polerio::VarPrepForStore($sessid) . "'";
        $pmldbconn->Execute($query);
        if ($pmldbconn->ErrorNo() != 0) {
            return false;
        }
        return true;
    }
    

    I thing that somewhere the script close the connection to db but I cannot find where. This trick make things work :-)

    Luca

     
  • Almost two years on and your post has resolved this issue for me.

    Thanks, Luca.