Page 1 of 1
defining types in mysql table
Posted: Mon Nov 22, 2004 7:02 am
by pelegk2
must i define the length for the type i select?
Posted: Mon Nov 22, 2004 7:46 am
by John Cartwright
You do not have have to define a length, as they have their defaults and maximum amount of allowed characters.
Posted: Mon Nov 22, 2004 8:08 am
by Maugrim_The_Reaper
It's not required - but as with all such things it's generally better to define them fully and set a default value in case null is passed. If nothing else it's make the database a little easier to manage.
It also does not take that time to do...
Posted: Mon Nov 22, 2004 8:09 am
by John Cartwright
It is generally frowned upon to not set a length, especially when the user controls the data going into your table
Posted: Mon Nov 22, 2004 8:43 am
by pelegk2
ok thnaks alot
Posted: Mon Nov 22, 2004 9:36 am
by Maugrim_The_Reaper
Generally good to set a max length on any user data

What if they decide to submit the collected works of shakespeare through your form multiple times...
