Forum Moderators: coopster

Message Too Old, No Replies

php/mysqli , and maximum field length?

How to get it?

         

stoub2000

10:53 am on May 28, 2006 (gmt 0)



Hi,

How can I know the maximum field length for every field of a table, using the mysqli extension? When I use the $field->max_length property of a field, it only gives the maximum length for the result set, not the maximum length for the table (for exemple if I have a VARCHAR(50), I want to get the value 50.

Thanks

eelixduppy

2:23 pm on May 28, 2006 (gmt 0)



Try mysql_list_fields [us3.php.net]. It describes the fields in the tables, also giving you a string for what type of field it is and its length. You will have to do some string manipulations to get just the value, however. Good luck!