MySQL database check, table check and submission built