title: Display table in php from mysql
body: <p>I'm doing a search engine, where after the student id is inserted in the text field, it will display the data about the student. I want to display it in the table form using the php code. But it doesn't work. Below is my code.</p>
  
  <pre><code>&lt;html&gt; 
  &lt;head&gt; 
      &lt;title&gt;MrBool Development Article&lt;/title&gt; 
  &lt;/head&gt; 
  &lt;body&gt; 
      &lt;form action="search.php" method="GET"&gt; 
          &lt;b&gt;Enter Search Term:&lt;/b&gt; 
          &lt;input type="text" name="term" size="50"&gt; 
          &lt;input type="submit" value="Search"&gt; 
      &lt;/form&gt; 
  
      &lt;?php 
          mysql_connect("localhost", "root", ""); 
          mysql_select_db("attendance_system"); 
          $sql = mysql_query("SELECT * FROM studentAttendance WHERE student_stud_matric LIKE '%$_GET[term]%'"); 
          while ($ser = mysql_fetch_array($sql)) {
              echo "&lt;table&gt;
                      &lt;thead&gt;
                          &lt;tr&gt;
                              &lt;th&gt;Student Matric&lt;/th&gt;
                              &lt;th&gt;Subject Name&lt;/th&gt;
                          &lt;/tr&gt;
                      &lt;/thead&gt;                                        
                      &lt;tbody&gt;";   
  
              echo "&lt;tr&gt;
                      &lt;td&gt;".$ser[student_stud_matric]."&lt;/td&gt;
                      &lt;td&gt;".$ser[course_course_code]."&lt;/td&gt;                                       
                  &lt;/tr&gt;";
  
              echo "&lt;/tbody&gt;&lt;/table&gt;";
          } 
      ?&gt; 
      &lt;hr&gt; 
      &lt;a href="index.php"&gt;Go Back&lt;/a&gt; 
  &lt;/body&gt; 
  &lt;/html&gt;
  </code></pre>