How to show data only his data while he login |
Hi everyone,
The condition is employee login by using email as username, and after login all employess data are shown in the table. But the condition i want is this: when an employee login, he only could see his data only. The condition now is : $this->datatables->select('id_users,full_name,email,address,images,salary'); $this->datatables->from('tbl_user'); It will show up all data,,so i modified it by adding this line $this->datatables->select('id_users,full_name,email,address,images,salary'); $this->datatables->from('tbl_user'); $this->datatables->where('email=".$this->session->email."'); But no data shown up in the table, how to fix this? I am sorry , i already google but still confuse, i think this is about getting record by session, any help will be very usefull since i am a beginner, thanks.
If you are using the query builder, the syntax for the where method is like this:
PHP Code: $this->datatables->where('email', $this->session->email);
I'm curious, what is the object $this->datatables? An alias for the usual $this->db? Or is it some custom class?
|
Welcome Guest, Not a member yet? Register Sign In |