Reputation: 53
How to check if a column exists in query builder Codeigniter 3? Example :
$query = $this->db->coluln_exists('column_name', 'table_name'); if($query == TRUE) { return TRUE; } else { return FALSE;}
Thanks,
Upvotes: 2
Views: 7638
Reputation: 805
if ($this->db->field_exists('field_name', 'table_name')) { // some code... }
You can see complete description here.
Upvotes: 7