MAX returns the highest value for a column among all the selected rows, so it has nothing to do with the max possible input length.
You may want to have a look at http://se.php.net/manual/en/mysqli-result.fetch-fields.php and http://se.php.net/manual/en/mysqli-stmt.result-metadata.php
But if you control the database yourself so that boundaries won't change without you knowing it, and somehow map data between tables and objects, e.g. using ORM, I'd recommend hard coding the max lengths and or min and max values in your classes' set member methods.
A more elaborate technique would be to keep a separte file(s) that desctibes all your tables/objects, either as SQL, PHP or some proprietary way, and then create a script that will produce the appropriate PHP and/or SQL code automatically. This way you will only have to make changes in one single place. And as an added upside, you don't have to write the basic code both for describing the db and your classes.