Displaying Muticolumn Headers and Data In Two Columns
<p>I need to select multi-column information from a table and display it in another table which has just two columns. The scenario is this:
First Table(multi-columns):</p>

<pre><code>      MATH111  MATH112  MATH113 MATH114
      67          89      54      23
</code></pre>

<p>I  want to  display it in this(two column table):</p>

<pre><code>       Course      Score
       MATH111      67
       MATH112      89
       MATH113      54
       MATH114      23
</code></pre>

<p>I am conversant enough in php to obtain and display the information from the multicolumn table:</p>

<pre><code>     "select * from xx where id=''";
      echo "&lt;table border='1'&gt;
   &lt;tr&gt;
&lt;th&gt;MATH111&lt;/th&gt;
  &lt;th&gt;MATH112&lt;/th&gt;
 &lt;th&gt;MATH113&lt;/th&gt;
&lt;th&gt;MATH114&lt;/th&gt;
  &lt;/tr&gt;";
while($row=(mysqli_fetch_assoc($result))
 {
echo "&lt;tr&gt;";
 echo "&lt;td&gt;" . $row['MATH111'] . "&lt;/td&gt;";
 echo "&lt;td&gt;" . $row['MATH112'] . "&lt;/td&gt;";
  echo "&lt;td&gt;" . $row['MATH113'] . "&lt;/td&gt;";
 echo "&lt;td&gt;" . $row['MATH114'] . "&lt;/td&gt;";
echo "&lt;/tr&gt;";
 }    
   echo "&lt;/table&gt;";
</code></pre>

<p>The table i want to display it in will be :</p>

<pre><code>       echo '&lt;table&gt;&lt;tr&gt;&lt;th&gt;Course&lt;/th&gt;&lt;th&gt;Score&lt;/th&gt;&lt;/tr&gt;';
</code></pre>

<p>What i need is help on code to display it as i have outlined above, which is in this format:</p>

<pre><code>         Course      Score
       MATH111      67
       MATH112      89
       MATH113      54
       MATH114      23
</code></pre>

<p>Please let me add that the values for the "course" column
is based on the table being selected.So i can not hard code it.            </p>
