Update query.php

edited out a bunch of redundant html to show just the php.