Display Php Array result in an Html table
<p>i was trying to display an array in php to an HTML table .but seems there's an issue .I'm in a process of learning php ,find several examples here in stack overflow , but doesn't work for my situation. 
what is the best way to display the result and to incorporate it in an HTML table? thanks everybody</p>

<p>here's the controller:</p>

<pre><code>&lt;?php include('inc/db_connect.php');?&gt;

&lt;?php
try
{
  $sql = "SELECT id GroupName, VideoTITLE, ByArtist FROM videoclip";
  $result = $pdo-&gt;query($sql);
}
catch(PDOException $e)
{
  $error = 'unable to fetch data: '.$e-&gt;getMessage();
  include'error.html.php';
  exit();
}
$URLS = array();
while ($row = $result-&gt;fetch())
{
  $URLS[] = array('id' =&gt; $row['id'], 'GroupName' =&gt; $row['GroupName'], 'VideoTITLE' =&gt; $row['VideoTITLE'], 'ByArtist'=&gt; $row['ByArtist'] );
}
</code></pre>

<p>here's the html table :</p>

<pre><code>&lt;div id="table_admin" class="span7"&gt;
        &lt;h3&gt;Videoclip List&lt;/h3&gt;

        &lt;table class="table table-striped table-condensed"&gt;

                &lt;thead&gt;
                &lt;tr&gt;
                &lt;th&gt;Song name&lt;/th&gt;
                &lt;th&gt;Group name &lt;/th&gt;
                &lt;th&gt;Artist &lt;/th&gt;
                &lt;/tr&gt;
                &lt;/thead&gt;
            &lt;?php foreach ($URLS as $URL){
                echo'&lt;tbody&gt;';
                echo'&lt;tr&gt;'; 
                echo'&lt;td&gt;'. $row['VideoTITLE']."&lt;/td&gt;";
                echo'&lt;td&gt;'. $row['GroupName'].'&lt;/td&gt;';
                echo'&lt;td&gt;'. $row['ByArtist'].'&lt;/td&gt;';
                echo'&lt;tr&gt;';
                echo'&lt;/tbody&gt;';
              }
            ?&gt;


        &lt;/table&gt;

    &lt;/div&gt;
</code></pre>
