title: How to print the whole database table from phpmyadmin using PDO in php file
body: <p>I am trying to print the whole database in tabular format in a php file using PDO. i have this database stored in phpmyadmin. But there are a lot of rows in there like name,id, etc etc... I have this following php code. i already made a connection to the database and added require_once() in the page. But i dont know how to print all these values in a tabular method. like showing it in a way a normal database will look like.  </p>
  
  <pre><code>$q="SELECT * FROM `employee`";
  
  $sth = $odb-&gt;prepare($q);
  $sth-&gt;execute();
  
  while ($r = $sth-&gt;fetch(PDO::FETCH_ASSOC)){
          // code here
      }
  </code></pre>
  
  <p>Can someone help me to display the table properly. That is if i run it in browser, i should see a table instead of that ugly array format </p>