Print the query results inside the submit function
The issue is due to the form submission and rendering process within Drupal.  Long story short, Drupal submits the form then re-renders the form page, which goes through a 'submission' process.  So, all the drupal_set_message calls are getting cleared during this process.

What you want to use is an AJAX callback on the submit button, populating a section of the form with the data retrieved.  And lucky for you the process is much simpler in Drupal 7.

To use the data again in a later form, look at multistep forms.