December 21, 2019
How to get table structure in CodeIgniter
In this tutorial we are going to see How to get table structure in CodeIgniter.
In some scenarios we need to get table column name in codeigniter.
Use below code to get table structure in CodeIgniter
1 2 3 4 5 |
$fields = $this->db->list_fields('table_name'); foreach ($fields as $field) { echo $field; } |