⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

List data with WHERE



Iszuddin Ismail

Iszuddin Ismail
  • profile picture
  • Member

Posted 12 April 2017 - 06:10 AM

My use case is where I have a set of users. And I want to display data only that belongs to that specific users.

 

When listing the records, is there a way I can add a WHERE in the SELECT or something like that?

 

Hope to get some pointers.


Iszuddin Ismail

Iszuddin Ismail
  • profile picture
  • Member

Posted 12 April 2017 - 06:24 AM

Nevermind. I just tried this out and it appears I can just add a "where" in there

 

$this->grocery_crud->where(array('user_id' => $_SESSION['user_id']));