title: Display query custom table on Wordpress
body: <p>I want to display query from custom table on my wordpress page:</p>
  
  <pre><code>table name: wp_formmaker_submits
  </code></pre>
  
  <p>field to display: element_value (with 6 rows on each data)</p>
  
  <p>This is the query result:</p>
  
  <blockquote>
    <p>2014-07-2211:13:00SpeedMacLindseyNewYork2014-07-2211:22:00FedExJackChloeLondon2014-07-2211:42:00DHLSteveDannoHawaii</p>
  </blockquote>
  
  <p>It should appear like</p>
  
  <pre><code>&gt; 2014-07-22 | 11:13:00 | Speed | Mac | Lindsey | New York
  &gt; 2014-07-22 | 11:22:00 | FedEx | Jack | Chloe | London
  &gt; 2014-07-22 | 11:42:00 | DHL | Steve | Danno | Hawaii
  </code></pre>
  
  <p>I need help with the <code>&lt;tr&gt;</code> and <code>&lt;td&gt;</code> structure, so the html table will look properly.</p>
  
  <p>This is my code:</p>
  
  <pre><code>global $wpdb;
  $result = $wpdb-&gt;get_results("SELECT element_value FROM wp_formmaker_submits WHERE DATE(date) = CURDATE()");
  echo "&lt;table border='1'&gt;";
  echo "&lt;tr&gt;&lt;td&gt;Date&lt;/td&gt;&lt;td&gt;Time&lt;/td&gt;&lt;td&gt;Carrier&lt;/td&gt;&lt;td&gt;Driver&lt;/td&gt;&lt;td&gt;Co Driver&lt;/td&gt;&lt;td&gt;Destination&lt;/td&gt;&lt;/tr&gt;";
  foreach($result as $wp_formmaker_submits){
  echo "&lt;td&gt;".$wp_formmaker_submits-&gt;element_value."&lt;/td&gt;";
  }
  echo "&lt;/table&gt;";
  </code></pre>
  
  <p>printr:</p>
  
  <pre><code>Array ( [0] =&gt; stdClass Object ( [id] =&gt; 7 [form_id] =&gt; 10 [element_label] =&gt; 1 [element_value] =&gt; 2014-07-22 [group_id] =&gt; 2 [date] =&gt; 2014-07-22 04:14:01 [ip] =&gt; ::1 ) [1] =&gt; stdClass Object ( [id] =&gt; 8 [form_id] =&gt; 10 [element_label] =&gt; 2 [element_value] =&gt; 11:13:00 [group_id] =&gt; 2 [date] =&gt; 2014-07-22 04:14:01 [ip] =&gt; ::1 ) [2] =&gt; stdClass Object ( [id] =&gt; 9 [form_id] =&gt; 10 [element_label] =&gt; 3 [element_value] =&gt; Speed [group_id] =&gt; 2 [date] =&gt; 2014-07-22 04:14:01 [ip] =&gt; ::1 ) [3] =&gt; stdClass Object ( [id] =&gt; 10 [form_id] =&gt; 10 [element_label] =&gt; 4 [element_value] =&gt; Mac [group_id] =&gt; 2 [date] =&gt; 2014-07-22 04:14:01 [ip] =&gt; ::1 ) [4] =&gt; stdClass Object ( [id] =&gt; 11 [form_id] =&gt; 10 [element_label] =&gt; 5 [element_value] =&gt; Lindsey [group_id] =&gt; 2 [date] =&gt; 2014-07-22 04:14:01 [ip] =&gt; ::1 ) [5] =&gt; stdClass Object ( [id] =&gt; 12 [form_id] =&gt; 10 [element_label] =&gt; 6 [element_value] =&gt; New York [group_id] =&gt; 2 [date] =&gt; 2014-07-22 04:14:01 [ip] =&gt; ::1 ) [6] =&gt; stdClass Object ( [id] =&gt; 13 [form_id] =&gt; 10 [element_label] =&gt; 1 [element_value] =&gt; 2014-07-22 [group_id] =&gt; 3 [date] =&gt; 2014-07-22 04:22:50 [ip] =&gt; ::1 ) [7] =&gt; stdClass Object ( [id] =&gt; 14 [form_id] =&gt; 10 [element_label] =&gt; 2 [element_value] =&gt; 11:22:00 [group_id] =&gt; 3 [date] =&gt; 2014-07-22 04:22:50 [ip] =&gt; ::1 ) [8] =&gt; stdClass Object ( [id] =&gt; 15 [form_id] =&gt; 10 [element_label] =&gt; 3 [element_value] =&gt; FedEx [group_id] =&gt; 3 [date] =&gt; 2014-07-22 04:22:50 [ip] =&gt; ::1 ) [9] =&gt; stdClass Object ( [id] =&gt; 16 [form_id] =&gt; 10 [element_label] =&gt; 4 [element_value] =&gt; Jack [group_id] =&gt; 3 [date] =&gt; 2014-07-22 04:22:50 [ip] =&gt; ::1 ) [10] =&gt; stdClass Object ( [id] =&gt; 17 [form_id] =&gt; 10 [element_label] =&gt; 5 [element_value] =&gt; Chloe [group_id] =&gt; 3 [date] =&gt; 2014-07-22 04:22:50 [ip] =&gt; ::1 ) [11] =&gt; stdClass Object ( [id] =&gt; 18 [form_id] =&gt; 10 [element_label] =&gt; 6 [element_value] =&gt; Hawaii [group_id] =&gt; 3 [date] =&gt; 2014-07-22 04:22:50 [ip] =&gt; ::1 ) [12] =&gt; stdClass Object ( [id] =&gt; 19 [form_id] =&gt; 10 [element_label] =&gt; 1 [element_value] =&gt; 2014-07-22 [group_id] =&gt; 4 [date] =&gt; 2014-07-22 04:43:31 [ip] =&gt; ::1 ) [13] =&gt; stdClass Object ( [id] =&gt; 20 [form_id] =&gt; 10 [element_label] =&gt; 2 [element_value] =&gt; 11:42:00 [group_id] =&gt; 4 [date] =&gt; 2014-07-22 04:43:31 [ip] =&gt; ::1 ) [14] =&gt; stdClass Object ( [id] =&gt; 21 [form_id] =&gt; 10 [element_label] =&gt; 3 [element_value] =&gt; DHL [group_id] =&gt; 4 [date] =&gt; 2014-07-22 04:43:31 [ip] =&gt; ::1 ) [15] =&gt; stdClass Object ( [id] =&gt; 22 [form_id] =&gt; 10 [element_label] =&gt; 4 [element_value] =&gt; Steve [group_id] =&gt; 4 [date] =&gt; 2014-07-22 04:43:31 [ip] =&gt; ::1 ) [16] =&gt; stdClass Object ( [id] =&gt; 23 [form_id] =&gt; 10 [element_label] =&gt; 5 [element_value] =&gt; Danno [group_id] =&gt; 4 [date] =&gt; 2014-07-22 04:43:31 [ip] =&gt; ::1 ) [17] =&gt; stdClass Object ( [id] =&gt; 24 [form_id] =&gt; 10 [element_label] =&gt; 6 [element_value] =&gt; Hawaii [group_id] =&gt; 4 [date] =&gt; 2014-07-22 04:43:31 [ip] =&gt; ::1 ) )
  </code></pre>