How to retrieve data from the database and display it in a html table using Codeigniter

前端 未结 3 626
余生分开走
余生分开走 2021-01-16 04:47

anyone please help me to retrieve the db data and how to view it in html table.is the coding i given is correct or not if not can you please say how i have to give. in order

3条回答
  •  佛祖请我去吃肉
    2021-01-16 05:10

    Do this in your edit_content function

    $result=$this->editcontent_model->get_contents();
    $this->load->view('edit_content/edit_content', $result);
    

    and in your view, access the content like:

    
      
    content; ?>
    
     
      
    

    You have to do this beacuse the $result is an associative array not a simple one. Hope this helped you.

提交回复
热议问题