Get Defined Field Length
Posted: Mon Feb 04, 2008 10:41 pm
I'm new to php/mySQL but I have a lot of experience in asp/SQL Server. In asp, I use the function rst.fields(myFieldName).definedsize, where rst is a recordset and myFieldName is a field name, to find the maximum number of characters that can be entered into text fields. I use this number to set the maxlength property of text boxes in a function that dynamically builds text boxes for my forms.
The closest thing I could find in php/mySQL is mysql_fetch_field but this is causing me two problems. 1. it returns the max length of the longest string in the field, not the defined size and 2. it requires the field index not the field name.
Does any one know how to return the defined field size of a field using the field name?
Thanks in advance.
The closest thing I could find in php/mySQL is mysql_fetch_field but this is causing me two problems. 1. it returns the max length of the longest string in the field, not the defined size and 2. it requires the field index not the field name.
Does any one know how to return the defined field size of a field using the field name?
Thanks in advance.