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

[eluser]Unknown[/eluser]
Hi there!
Does anyone know if it's possible to add a Where-Clause which will be added to any SQL-Query automatically?

For example: I want to make sure my users select/update/delete only their DB-data. So for Security I added to all my SQL-Querys:

$this->db->where('owner', $user_id);


For simplicity and I don't forget to add this where-clause somewhere, is it possible to setup somehow a "globally" valid where-statement, which is added to any sql-query by default? This doesn't need to be application-wide, but at least Model-wide

Thanks for any hints!


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