title: Display data from database inside <table> using wordpress $wpdb
body: <p>Can someone help me, how to code the logic to print the data from my database into a <code>&lt;table&gt;</code>?</p>
  <pre><code>&lt;table border=&quot;1&quot;&gt;
      &lt;tr&gt;
       &lt;th&gt;Firstname&lt;/th&gt;
       &lt;th&gt;Lastname&lt;/th&gt;
       &lt;th&gt;Points&lt;/th&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;?php
          global $wpdb;
          $result = $wpdb-&gt;get_results ( &quot;SELECT * FROM myTable&quot; );
          foreach ( $result as $print )   {
              echo '&lt;td&gt;' $print-&gt;firstname.'&lt;/td&gt;';
              }
        ?&gt;
      &lt;/tr&gt;               
  &lt;/table&gt;
  </code></pre>
  <p><img src="https://i.stack.imgur.com/f4vKl.png" alt="table" /></p>
  <p>I know this is so basic, but I'm having a hard time making this work.</p>