[development] Form field maxlengths vs. database field sizes

lodewijk evers l.evers at ontwerpwerk.nl
Thu Feb 9 13:47:48 UTC 2006


> > This issue stems from Killes' comment [
> > http://drupal.org/node/46306#comment-71971 ]. Should form field 
> > maxlengths be consistent with corresponding database field sizes or 
> > should unicode encoding be accounted for?
> Drupal has no way of knowing what the field size of the 
> database is, and as such the forms api can't take that into account.

Achtually, php can get the complete properties of a mysql
database/table/field ..including maximum field sizes ( mysql_field_len(),
mysql_field_type() and mysql_field_flags() ),
For postgres if's similar ( pg_field_size() ).

So it must be possible for drupal to get to that information too.

Regards,

Lodewijk Evers
http://www.ontwerpwerk.nl



More information about the development mailing list