CodeIgniter Forums
Get only specific fields using getFieldData? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Get only specific fields using getFieldData? (/showthread.php?tid=80294)



Get only specific fields using getFieldData? - blaasvaer - 10-13-2021

I can get all "information_schema.columns" using:
PHP Code:
$this->db->getFieldData$table ); 
But, how do I get only info on specific columns, like 'name' and 'type'.
I'm looking for the equivalent of:

PHP Code:
EXAMPLESELECT column_namedata_type FROM information_schema.columns WHERE table_name '$table'


By default I get all these:
Code:
default, max_length, name, nullable, primary_key, type

I'm only interested in:
Code:
name, type