I’ve been doing some searching on the Internet, but I can’t for the life figure this out:
Can I force a MySQL table column to ONLY accept a set number of characters (e.g. 5 numbers ONLY, not 4 numbers nor 6 numbers)? I’ve read the MySQL documentation for some various data types but haven’t really discovered anything yet.
In a rather unfortunate move, I can’t perform reg-ex checking in PHP that easily right now, and would like to take the easy way out by forcing this check in the database itself. Thanks in advance!
you need to write a layer of code to do things like
trigger BEFORE INSERT