By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,968 Members | 1,843 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,968 IT Pros & Developers. It's quick & easy.

Garbage Collection with Custom Session Handlers?

P: 1
Hello all,

I've been at trying to implement custom session handlers with a postgreSQL database and am having some trouble with the garbage collection.

What I've got now sure doesn't work:

function gc($lifetime) {
$query = "DELETE FROM sessioninfo
WHERE expiration < ". time() - $lifetime;
$result = pg_query($query);
return pg_affected_rows($result);
}

Here's the errors pointing to this function:

Warning: pg_query() [function.pg-query]: Query failed: ERROR: syntax error at or near "-" at character 1 in ...

Warning: pg_affected_rows(): supplied argument is not a valid PostgreSQL result resource...

Does anybody know what gives here?

Thanks for your time,
bluedog357
Sep 8 '06 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.