How to check a field or column exists in a table or not in Codeigniter?

by kade.hermiston , in category: Technology , 3 years ago

How to check a field or column exists in a table or not in Codeigniter?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by cristobal , 3 years ago

Code for Checking a field or column exists or not in a Codeigniter table.

1
2
3
4
if ($this->db->field_exists('field_name', 'table_name'))
{
        // some code...
}