ItSolutionStuff.com

How to Get All Tables List in Codeigniter?

By Hardik Savani • November 5, 2023
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

Hardik Savani

I'm a full-stack developer, entrepreneur, and founder of ItSolutionStuff.com. Passionate about PHP, Laravel, JavaScript, and helping developers grow.

📺 Subscribe on YouTube

We Are Recommending You

How to Get Last Executed Query in Codeigniter?

Read Now →

Codeigniter Dynamic Highcharts Example

Read Now →

Codeigniter Create Zip File and Download Example

Read Now →

Codeigniter Create Dynamic Tree View using Treeview JS

Read Now →

Codeigniter Google Recaptcha Form Validation Example

Read Now →

Codeigniter Ajax Pagination using JQuery Example

Read Now →

Codeigniter Delete Multiple Rows using Checkbox Example

Read Now →

Codeigniter JQuery Ajax Autocomplete Search using Typeahead

Read Now →

Codeigniter Confirm Box Before Delete Record Example

Read Now →

How to Create Dynamic Sitemap in Codeigniter?

Read Now →

Codeigniter Multiple Database Connection Example

Read Now →

Codeigniter Dynamic Dependent Dropdown using Ajax Example

Read Now →

Codeigniter Generate PDF from View using Dompdf Example

Read Now →

Codeigniter Select2 Ajax Autocomplete from Database Example

Read Now →