Using '->where()' in PHP file to restrict filter based on SESSION USER / LOGIN
Using '->where()' in PHP file to restrict filter based on SESSION USER / LOGIN
Happy Evening one and All,
Following is the code used to fetch specific row corresponding to specific Account Manager based on Session/Login.
->where( 'Accoutn_Manger', $_SESSION['SESS_FIRST_NAME'].' '.$_SESSION['SESS_LAST_NAME']).
I understood that where() can be used to force filter as the data table fetches data from MySQL. I have super admin and following is user User Level details.
Account Manager = User Level = 4
Super Admin = User Level = 1
So if Super Admin log's in the datatable should display all data i.e. without Account Manager Restriction - So tried following and found not working.
->where( 'Accoutn_Manger', $_SESSION['SESS_FIRST_NAME'].' '.$_SESSION['SESS_LAST_NAME'], $_SESSION['SESS_USER_LEVEL'] = 4).
Any help would be greatful.
This question has an accepted answers - jump to answer
Answers
Could you write the WHERE SQL statement that you are trying to generate please, and I'll translate it into the Editor PHP libraries. I'm not clear if you need an AND or an OR statement.
Thanks,
Allan
Sure Allan, sorry for the confusion... Please find the SQL statement.
SELECT * FROM
table1_dataWHERE user_level = 4 AND account_manager = "John";
-
For an AND condition, call
where
twice.Allan
Thanks Allan,