⚠ 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

crud render for examples tables but not my tables



kabin.tamrakar

kabin.tamrakar
  • profile picture
  • Member

Posted 09 October 2015 - 08:22 AM

Dear all,

 

I made following function in examples.php

public function mydisplay()
        {
                try{
                        $crud = new grocery_CRUD();
                        $crud->set_theme('datatables');
                        $crud->set_table('test');
 
                        $output = $crud->render();
                        $this->_example_output($output);
                } catch(Exception $e){
                        show_error($e->getMessage().' --- '.$e->getTraceAsString());
                        }
        }
It does not display anything but when I set table name to be "film" i.e. in examples database it works it displays. And my table test is also in same database grocery_crud as film and database.php file is configured accordingly.
 
Please suggest .
 
Thank you in advance

 


titu

titu
  • profile picture
  • Member

Posted 14 October 2015 - 18:39 PM

does your table have a primary key? If it doesn't  it could be the reason.


kabin.tamrakar

kabin.tamrakar
  • profile picture
  • Member

Posted 15 October 2015 - 20:20 PM

does your table have a primary key? If it doesn't  it could be the reason.

Yes it was the reason thank you :)