clay1 Posted March 28, 2011 Share Posted March 28, 2011 This function is throwing the following error: invalid input syntax for type timestamp "1301297896" function removeInactiveUsers(){ if(!TRACK_VISITORS) return; $timeout = time()-USER_TIMEOUT*60; $result = pg_query_params($this->connection, "delete from active_users where timestamp < $1", array($timeout)); $this->calcNumActiveUsers(); } I know the problem is with $timeout using a php timestamp vs postgresql timestamp but I'm not sure how to fix that Link to comment https://forums.phpfreaks.com/topic/231928-invalid-input-syntax-for-type-timestamp/ Share on other sites More sharing options...
clay1 Posted March 28, 2011 Author Share Posted March 28, 2011 $result = pg_query_params($this->connection, "delete from active_users where timestamp < to_timestamp($1)::TIMESTAMP", array($timeout)); Seems to be working Link to comment https://forums.phpfreaks.com/topic/231928-invalid-input-syntax-for-type-timestamp/#findComment-1193159 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.