Display database info into html table Wordpress

admin

Administrator
Staff member
I have the table called: persona, in my database.
I just need to retrieved the data in this table into a html table inside a page in wordpress. SO far this is what i have:

Code:
<table border="1">
<tr>
 <th>Firstname</th>
 <th>Lastname</th>
 <th>Points</th>
</tr>
<tr>
  <?php
    global $wpdb;
    $result = $wpdb->get_results ( "SELECT * FROM persona" );
    foreach ( $result as $print )   {
        echo '<td>' $print->ID_per.'</td>';
        }
  ?>
</tr>



i added in the specific page i am working on and publish it but when i refresh the page it only shows the code printed in the page. I wonder if i am puting the code in the right place or i do not know where to put it.

Look at the images below:
<a href=" " rel="nofollow noreferrer"><img src=" " alt="enter image description here"></a>