views:

33

answers:

2

I'm having a really strange and frustrating issue. On one page, an existing and often used one, I have this query:

SELECT COUNT(*) AS count FROM uvusers WHERE vdate IS NULL

It works exactly as expected and always has. On a new page I'm working on, I have this query:

SELECT COUNT(*) AS count FROM uvusers WHERE vdate IS NULL

This generates a permission denied error in the PHP log. The user does not change between these two pages and queries on different tables on the new page work exactly as expected.

I've triple-checked that the permissions are correct - the query should work. Any help would be appreciated.

+1  A: 

Are you sure you have selected the right database?

Byron Whitlock
Yes, because other queries on the same [new] page work exactly as expected.
Shadow
A: 

For whatever reason, the pg_query() calls wasn't finding an implied connection, so I just had to add the variable containing the connection resource as the first argument.

Shadow