php - Grocery CRUD always showing No items to display but shows total number grid footer -
i have problem, using grocery crud
, when list data, shows no items display
shows total number of records in table
controller
class manage_home extends ci_controller {
public function __construct() { parent::__construct(); $this->load->database(); $this->load->helper('url'); $this->load->library('grocery_crud'); } public function all_intro() { // echo "all well"; $crud = new grocery_crud(); $crud->set_table('tbl_home_information'); $crud->columns('pk_information_id','information_title','information_status','information_added'); $crud->fields('pk_information_id','information_title','information_status','information_added'); $crud->display_as('pk_information_id','id'); $crud->display_as('information_title','title'); $crud->display_as('information_added','date'); $crud->display_as('information_status','status'); $output = $crud->render(); $this->_example_output($output, "manage brands"); } }
edit scheme of table
make sure $crud->columns('pk_information_id','information_title','information_status','information_added');
field names of database tables. try adding $crud->set_primary_key('pk_information_id','"your database table name here"');
if pk_information_id
set primary key. , try declare $this->_example_output($output, "manage brands");
$this->_example_output($output,'"your controller view url"');
.
sorry grammar, hope helps you.
Comments
Post a Comment