Update Query to new DB Schema

Modify query.php to use new column names in
updated database schema.