I am creating a custom search block, I have created a form in the block. Here is my form_submit. I need to print a html table of some of the fields in the $result array. I am using Drupal_set_message(), I need to show the results in a table instead, so that user can print the page
$text = $form_state['values']['text'];
$query = db_select('table_1', 'n');
$query->fields('n', array('id'));
$query->fields('n', array('phone'));
$query->fields('n', array('name'));
$query->condition('n.p_id', $text, '=');
$column_name = $query->execute();