![]() |
Enum field type not supported ? - $this->db->field_data('table_name'); - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Enum field type not supported ? - $this->db->field_data('table_name'); (/showthread.php?tid=41021) |
Enum field type not supported ? - $this->db->field_data('table_name'); - El Forum - 04-26-2011 [eluser]Brad Martin[/eluser] Hi Guys, Trying to get a list of a specific tables fields (Database is MYSQL) and their types. One field is an ENUM field, when codeigniter returns the fields and their types it lists this particular field type as a string with its $field->max_length as 8 which is the length of the largest option. Just wondering if their is a specific reason why codeigniter does or is it a bug of some kind ? Thanks Enum field type not supported ? - $this->db->field_data('table_name'); - El Forum - 04-26-2011 [eluser]InsiteFX[/eluser] It's doe's not handle he enum type, I just had to write a create function because dbforge would not handle it either! This needs to be updated in the database... InsiteFX Enum field type not supported ? - $this->db->field_data('table_name'); - El Forum - 04-28-2011 [eluser]Brad Martin[/eluser] Thanks, I got it working how i needed to modified the field_data() function in ./system/database/DB_driver.php to call the enum_select() function from (http://ellislab.com/forums/viewthread/101110/) that i also added to DB_driver.php Just thought i would post my fix for anyone else that may need it. I do realise this probably isn't the best way but it works! also adds unnecessary database calls if you don't need to check if the type is enum for each field. Code: function field_data($table = '') Code: function enum_select( $table , $field ) Enum field type not supported ? - $this->db->field_data('table_name'); - El Forum - 04-28-2011 [eluser]InsiteFX[/eluser] Thanks! But now you have the problem that it will be over-written with a new update of CodeIgniter! Best to report it to the Reactor Team as an enhacement. InsiteFX |