How to Get All Tables List in Codeigniter?
It is a amazing deal with database to get all tables list using mysql query in php codeigniter 3 project. this type of task it might be required on big project. So if you require then i think you have knowledge of mysql query. here we will display add the table list using codeigniter mysql query.
We will execute mysql query like as bellow for getting list of all tables in codeigniter. let's just see bellow query.
SHOW TABLES FROM `database_name`
Now you simply run in your controller like this way with codeigniter.
Example:
$tables=$this->db->query("SHOW TABLES FROM `codeig`")->result_array();
foreach($tables as $key => $val) {
echo $val['Tables_in_codeig']."
";}
Output:
demo_click
demo_viewer
events
item
items
I hope it can help you....
Hardik Savani
I'm a full-stack developer, entrepreneur and owner of ItSolutionstuff.com. I live in India and I love to write tutorials and tips that can help to other artisan. I am a big fan of PHP, Laravel, Angular, Vue, Node, Javascript, JQuery, Codeigniter and Bootstrap from the early stage. I believe in Hardworking and Consistency.
We are Recommending you
- How to Get Last Executed Query in Codeigniter?
- Codeigniter Dynamic Highcharts Example
- Codeigniter Create Zip File and Download Example
- Codeigniter Create Dynamic Tree View using Treeview JS
- Codeigniter Google Recaptcha Form Validation Example
- Codeigniter Ajax Pagination using JQuery Example
- Codeigniter Delete Multiple Rows using Checkbox Example
- Codeigniter JQuery Ajax Autocomplete Search using Typeahead
- Codeigniter Confirm Box Before Delete Record Example
- How to Create Dynamic Sitemap in Codeigniter?
- Codeigniter Multiple Database Connection Example
- Codeigniter Dynamic Dependent Dropdown using Ajax Example
- Codeigniter Generate PDF from View using Dompdf Example
- Codeigniter Select2 Ajax Autocomplete from Database Example