CodeIgniter Forums
Is there a bug in field_data() and max_length for string types? - 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: Is there a bug in field_data() and max_length for string types? (/showthread.php?tid=8339)



Is there a bug in field_data() and max_length for string types? - El Forum - 05-14-2008

[eluser]Unknown[/eluser]
The max_length apparently maxes out at 7 for string fields.
Code:
$query = $this->db->query(...);
$fields = $query->field_data();
print_r($fields);
The string fields max_length items are correct if they are declared in my database as char(x) where x is less than 7, but incorrect if over seven. I haven't tried this with varchars.

I'm using version 1.6.1 and MySQL.


Is there a bug in field_data() and max_length for string types? - El Forum - 06-28-2009

[eluser]Tobz[/eluser]
it seems to me that the max_length item is the length of the longest record in the database, not the actual set maximum for the field. I'm not sure if this is a bug or not, but it seems like it to me.
still as of 1.7.1

anyone else have anything to say on this? is it a bug?