Hi,

1st, thanks to all who developed this very useful module. It has worked for me up until the day i decided i needed to use db_rewrite_sql. The problem is likely my lack of understanding of drupal in general, but any help in resolving this would be greatly appreciated.

I'm using CCK to create a custom node type, and then accessing the various nodes via a db_query call. When i run the code as admin, I have no problems (this is a guess, but i assume admin doesn't call any hook_db_rewrite_sql)

I've been getting this ambiguous query warning whenever i try to call db_query with a returned sql call from db_rewrite_sql, which includes an INNER JOIN that looks to me like it should work and not throw 'ambiguous' warning at me... In fact i kind of dislike the ambiguity of the warning message....

The error:
user warning: Column 'nid' in where clause is ambiguous query: SELECT field_date_value FROM content_type_apwire INNER JOIN node_access na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 1 AND na.realm = 'example') OR (na.gid = 4 AND na.realm = 'example_author'))) AND ( nid = 1667) in /var/www/html/includes/database.mysqli.inc on line 151.

Btw, a working mysql call from an administrator account looks like: SELECT field_date_value FROM {content_type_apwire} WHERE nid = 1629

I could hack around this and not use db_rewrite_sql but i'd rather fix it the right way. I know nothing of using relational DB calls like INNER JOIN but suspect it or something like my access_node table has a problem.... I'm using private.module v1.1.2.1 with drupal 5.1, mysql 5.0.22, & php 5.1.6

again, thanks for any help or direction on this issue of mine,

-hagan

Comments

adamps’s picture

Status: Active » Closed (outdated)

Tidying up ancient D5 support request.