refactor PMA_sqlQueryForm and fix code style