Don't waste your time use EDFP library.
Now is very simple to display and edit ( in different ways: text , textarea, select , radio button, date , slider, checkbox, switch on/off button, map, video, colorpicker, password, image, file, html editor ) every field you want from mysql database with EDFF or EDFP library.
1 Include EDFF or EDFP ( Edit Database Field PRO ) library into your project.
2 Just generate code with WDH CodeGenerator.
You can download EDFF or EDFP library and find CodeGenerator here : http://codegenerator.wdh.im
You can find live demo here : http://labs.wdh.im/example.php
Hope that help you !