castleinfo
asked on
PHPLIB and postgresql
Can some one pls tell me why i get this with :
redhat 6,mod_php0.9;modphpimap0.9 ;modphppgs ql0.9 and phplib (latest)
PHP works fine database access works fine sessions seem to work (almost)
but I get the following error on every page :
Warning: This compilation does not support pg_cmdtuples() in db_pgsql.inc on line 122
Warning: PostgresSQL query failed: ERROR: Cannot insert a duplicate key into a unique index in db_pgsql.inc on line 52
Database error: Invalid SQL: insert into active_sessions ( sid, name, val, changed ) values ('821b6c41882e2148431ffa52 ba56e561', 'Example_Session', 'RXhhbXBsZV9TZXNzaW9uOiR0a GlzLT5pbiA 9ICcnOyAkd Ghpcy0+cHQ gPSBhcnJhe SgpOyAkdGh pcy0+cHRbJ 3MnXSA9ICc xJzsgJHRoa XMtPnB0Wyd hdXRoJ10gP SAnMSc7ICR HTE9CQUxTW ydzJ10gPSA nMyc7ICRHT E9CQUxTWyd hdXRoJ10gP SBuZXcgRXh hbXBsZV9EZ WZhdWx0X0F 1dGg7ICRHT E9CQUxTWyd hdXRoJ10tP mF1dGggPSB hcnJheSgpO yAkR0xPQkF MU1snYXV0a CddLT5hdXR oWyd1aWQnX SA9ICdmb3J tJzsgJEdMT 0JBTFNbJ2F 1dGgnXS0+Y XV0aFsncGV ybSddID0gJ yc7ICRHTE9 CQUxTWydhd XRoJ10tPmF 1dGhbJ2V4c CddID0gJzI xNDc0ODM2N DcnOyAkR0x PQkFMU1snY XV0aCddLT5 hdXRoWydyZ WZyZXNoJ10 gPSAnMjE0N zQ4MzY0Nyc 7ICRHTE9CQ UxTWydhdXR oJ10tPmF1d GhbJ3VuYW1 lJ10gPSAna 3Jpcyc7IA= =', '20000107092418')
PostgreSQL Error: 1 (ERROR: Cannot insert a duplicate key into a unique index )
Session halted.
redhat 6,mod_php0.9;modphpimap0.9
PHP works fine database access works fine sessions seem to work (almost)
but I get the following error on every page :
Warning: This compilation does not support pg_cmdtuples() in db_pgsql.inc on line 122
Warning: PostgresSQL query failed: ERROR: Cannot insert a duplicate key into a unique index in db_pgsql.inc on line 52
Database error: Invalid SQL: insert into active_sessions ( sid, name, val, changed ) values ('821b6c41882e2148431ffa52
PostgreSQL Error: 1 (ERROR: Cannot insert a duplicate key into a unique index )
Session halted.
ASKER
Thanks, I was thinking along the same lines and so tried the 0.12 versions of mod_php3 etc.. But this gave an error with apache on start, So I unistalled went back to 0.9 and tried you fix. Yes it gets rid of the cmd_tuples error but I still get the rest of the error:
Per Session Data: 3
Per Session Data is referenced by session id. The session id is propagated using either a cookie stored in the users browser or as a GET style parameter appended
to the current URL.
Per Session Data is available only on pages using the feature "sess" in their page_open() call. Database error: Invalid SQL: insert into active_sessions ( sid, name,
val, changed ) values ('d10ff08ba6b53aa56e705aba a824d24b', 'Example_Session',
'RXhhbXBsZV9TZXNzaW9uOiR0a GlzLT5pbiA 9ICcnOyAkd Ghpcy0+cHQ gPSBhcnJhe SgpOyAkdGh pcy0+cHRbJ 3MnXSA9ICc xJzsgJEdMT 0JBTFNbJ3M nXSA9ICczJ zsg',
'20000110042848')
PostgreSQL Error: 1 (ERROR: Cannot insert a duplicate key into a unique index )
Session halted.
Any ideas ?
Per Session Data: 3
Per Session Data is referenced by session id. The session id is propagated using either a cookie stored in the users browser or as a GET style parameter appended
to the current URL.
Per Session Data is available only on pages using the feature "sess" in their page_open() call. Database error: Invalid SQL: insert into active_sessions ( sid, name,
val, changed ) values ('d10ff08ba6b53aa56e705aba
'RXhhbXBsZV9TZXNzaW9uOiR0a
'20000110042848')
PostgreSQL Error: 1 (ERROR: Cannot insert a duplicate key into a unique index )
Session halted.
Any ideas ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Did my comment help you ?
ASKER
Sorry I gave up for a short while.. Yes the changes cleared the tuples error, but now the session counter doesn't actualy update !
http://www.castleinfo.co.uk/index.php3
I added some echo's to check the session variable. (hence the stuff at the bottom of the screen.)
Any more ideas ? It's odd because I have IMP running now (as of two days ago) and that uses phplib.
Should I try an older version of PHPLIB that may work with my current rpms ?
Thanks for the help so far.
http://www.castleinfo.co.uk/index.php3
I added some echo's to check the session variable. (hence the stuff at the bottom of the screen.)
Any more ideas ? It's odd because I have IMP running now (as of two days ago) and that uses phplib.
Should I try an older version of PHPLIB that may work with my current rpms ?
Thanks for the help so far.
Try to remove error_reporting lines I suggested to add before - I suggest there is a problem with SQL call now ...
ASKER
This is the current modification :
## Next line of code provided by maxkir on experts exchange
## $old_err_rep = error_reporting(0); ##remove error codes
$this->db->query(sprintf(" SELECT count(*) from %s where sid='$id' AND
name='$name'", $this->database_table)); if (!$this->db->num_rows())
{
$this->db->query($iquery);
}
else
{
$this->db->query($uquery);
}
## error_reporting($old_err_r ep); ##turn them back on
return $ret;
}
## Next line of code provided by maxkir on experts exchange
## $old_err_rep = error_reporting(0); ##remove error codes
$this->db->query(sprintf("
name='$name'", $this->database_table)); if (!$this->db->num_rows())
{
$this->db->query($iquery);
}
else
{
$this->db->query($uquery);
}
## error_reporting($old_err_r
return $ret;
}
ASKER
Thanks for your help, apparently you can get cmd_tuples to work if you recompile the source etc.. but now I've already written my own session handling code that works with cookies and MD5 passwords fine...
No harm giving you the points though !
No harm giving you the points though !
Warning: This compilation does not support pg_cmdtuples() in db_pgsql.inc on line 122
It looks like your compilation of modphppgsql0.9 does not support function pg_cmdtuples(). I have no idea why.
So because of that affected_rous function returns 0 instead of 1 and tryes to do another insert.
Possible workaround:
editt file ct_sql.inc in php-lib and add this line:
$old_err_rep = error_reporting(0);
before line which contains:
if ( $this->db->affected_rows()
(for me it is line 91)
and add this:
error_reporting($old_err_r
$old_err_rep = error_reporting(0);
if ( $this->db->affected_rows()
&& !$this->db->query($iquery)
$ret = false;
}
error_reporting($old_err_r
This should remove warnings, but code will work anyway.