custom search

Is this the basic idea of how I would do custom query search? I realize to use global wpdb and the rest of the script of course.

<input type="hidden" name="<?php $query = $wpdb->get_results('SELECT * FROM ' . $address_table . 'WHERE address = ' . $city); ?>" value="artworks" />