I want to know the structure of a table. How I can do it in CodeIgniter. Using database class I got 'Invalid SQL Statement' error when I ran $this->db->query('desc mytable');
Try:
$fields = $this->db->list_fields('table_name');
foreach ($fields as $field)
{
echo $field;
}
From manual