⚠ 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

grocery and where



ziosteve93
  • profile picture
  • Member

Posted 10 March 2012 - 13:54 PM

1) Why it doesn't work?


$this->grocery_crud->set_table('table_name')->where('field_name', 'value')


2) It's possible to filter a relation ?

3) Can I use SQL commands with Grocery

4) Can I create a select manually?


Thanks to all!

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 11 March 2012 - 11:40 AM

1) I don't know why it doesn't work. It doesn't make sense to not work since the where functionality is in grocery CRUD from version 0.8 . Can you please post your function to see what is wrong with it?
2) The relation filter is not possible to the version 1.1.8 but it is possible for version 1.2 that it is not yet released. You can download it from the trunk version of github.The 4th argument is the where clause and the 5th is the order by clause. For example in your case you will have something like this:


$crud->set_relation('idUser','users','surname',array('status' => 1));

3) and 4) Yes it is but the only way to do it right now it with the set_model. So you can set a custom model and change only the get_list function . You can see an example of how to use the set model at: http://www.grocerycr...tions/set_model and /topic/90-how-to-create-an-extension-for-grocery-crud-real-example-included/. In the future I will try to add a functionality to insert a total custom query in grocery CRUD . I am not suggesting you to use set_model if it is the first time that you use grocery CRUD. The best way to use it is to be familiar with grocery CRUD and after this if you believe that you need something really custom you can try with the set_model method.