$this->res = @pg_execute($this->session, $query);
PHP is therefore trying to assign a query result to a property that
doesn't exist. I would have expected PHP to throw an error at this
but it may have been obscured with your logging settings, I'm not
Close - the '@' before pg_execute is hiding the notice/warning.
I'd say check your database username/password are correct.
Yeah I noticed that, but the line below it does a check to see if the
pg_execute command succeeded, and if it didn't it kills the script,
but that's not happening - it's getting further down the line, which
is why I think $this->res is not being persisted across method calls.