The code does not make sense at all. It seems that you have gotten too far and too fast without a proper foundation and understanding of the web development using HTML, PHP, and MySQL.
Start learning HTML5, then PHP, and then put them together to make a form. When you succeed, then bring in the database part.
Refer:
1.
http://www.codeproject.com/Learn/html/[
^]
2.
PHP 5[
^]
3.
PHP 5 Form Handling[
^]
4.
MySQL Database[
^]
Remember - "Rome was not built in one day". Happy learning.