MySQL has nothing to do with forms :P A server side script gets the data from the forms, validates it and sends it to the database if instructed to do so.
HTML alone can't work with forms. It can just show them. To validate a form it's best to use a Client Side Scripting Language like JavaScript.
