Enum field type not supported ? - $this->db->field_data('table_name'); |
[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
[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
[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 )
[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 |
Welcome Guest, Not a member yet? Register Sign In |