Hi folks. I'm having a very, very strange problem here.
I've got a query which is generated and executed in a php script. It scans a table of "areas" in a cms, a hierarchical folder structure stored in a table, and returns a list of users with access to any content which exists in the tree under the specified folder.
The results it is returning when executed in the php script are correct. However, when I turn on ADOdb's debugging in the application to get the query and run it from the command line the results are different.
For example, the following query which is output as the query executed by ADOdb's debugging returns two results from the php script and one from the command line:
And the following query returns two results from the php script and none from the command line:
Does anyone have any idea why I might be getting these different results? It makes absolutely no sense to me that the results would be different when executed within the php script or from the command line, since the query is exactly the same.
I'm getting the correct, desired results from within the php scripts which is the most important thing, but this will bug me until I figure it out so if anyone has any insight it is greatly appreciated.
Cheers and TIA.
Pablo
I've got a query which is generated and executed in a php script. It scans a table of "areas" in a cms, a hierarchical folder structure stored in a table, and returns a list of users with access to any content which exists in the tree under the specified folder.
The results it is returning when executed in the php script are correct. However, when I turn on ADOdb's debugging in the application to get the query and run it from the command line the results are different.
For example, the following query which is output as the query executed by ADOdb's debugging returns two results from the php script and one from the command line:
Code:
select x.u_id, g.g_id, g.name as group_name, u.username, x.status
from cms_access x, cms_groups g, cms_users u, cms_group_membership gm
where x.a_id in (select a.a_id from cms_areas a
where (1 = 195 and (a.a_id = 1 or a.path like '1, %'))
or (1 != 195 and (a.path like '%, 195, %' or a.path like '%, 195')))
and gm.g_id = g.g_id
and gm.u_id = u.u_id
and x.g_id = g.g_id
and x.u_id = u.u_id
group by x.u_id, x.g_id, g.g_id, group_name, u.username, x.status
order by group_name, username
Code:
select x.u_id, g.g_id, g.name as group_name, u.username, x.status
from cms_access x, cms_groups g, cms_users u, cms_group_membership gm
where x.a_id in (select a.a_id from cms_areas a
where (1 = 195 and (a.a_id = 1 or a.path like '1, %'))
or (1 != 195 and (a.path like '%, 195, %' or a.path like '%, 195')))
and gm.g_id = g.g_id
and gm.u_id = u.u_id
and x.g_id = g.g_id
and x.u_id = u.u_id
group by x.u_id, x.g_id, g.g_id, group_name, u.username, x.status
order by group_name, username
I'm getting the correct, desired results from within the php scripts which is the most important thing, but this will bug me until I figure it out so if anyone has any insight it is greatly appreciated.
Cheers and TIA.
Pablo