Welcome Guest, Not a member yet? Register   Sign In
Add "global" where clause to any SQL-Query
#3

[eluser]Unknown[/eluser]
great thanks a lot!

actually this does exactly what I asked for ... but after testing it, I see that I can't actually work this way ;-) as this where-clause is now added to ALL queries (yeah, i know I asked for it Wink - so also to queries which don't have an "owner"-column like the CI-"session"-table, or e.g. I'm using ION_AUTH which uses Joins so a simple "where(‘owner’, $user_id)" will end up in an db-error: "Column 'owner' in where clause is ambiguous" (because of using joins).

any other idea I can add this now not "globally" but only Model-wide, so it is only effect my Model-Queries?


Messages In This Thread
Add "global" where clause to any SQL-Query - by El Forum - 08-09-2010, 09:51 AM
Add "global" where clause to any SQL-Query - by El Forum - 08-09-2010, 10:20 AM
Add "global" where clause to any SQL-Query - by El Forum - 08-09-2010, 10:44 AM



Theme © iAndrew 2016 - Forum software by © MyBB