MasterKaos
Programmer
I have a lot of varchar fields of various lengths in my database. I want to implelemnt some simple HTML validation for my PHP pages, using the "maxlength" attribute of input statemaents to limit the max length to the length of the fields.
Are there any MySQL or PHP funcitons that will give me the length for a given field? I've looked around and so far i think the only way to do this would be to use the desc statement in MySQL and then use substring functions in PHP to get rid of the varchar() bit and be left with just the number. Was wonderring if there is a better way. Oh my database type is innoDB or whatever the default is. I'm running MySQL 4.0.20-standard and PHP 4.3.7
Thanks!
----------------------------------------------------------------------------
The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.
Are there any MySQL or PHP funcitons that will give me the length for a given field? I've looked around and so far i think the only way to do this would be to use the desc statement in MySQL and then use substring functions in PHP to get rid of the varchar() bit and be left with just the number. Was wonderring if there is a better way. Oh my database type is innoDB or whatever the default is. I'm running MySQL 4.0.20-standard and PHP 4.3.7
Thanks!
----------------------------------------------------------------------------
The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.