This is the original PHP script which works perfectly:
//This script pulls monolingua data out and lists the top 5 suggestions.
$englishinput=mysql_real_escape_string($_POST['englishinput']);
$query="SELECT monolingua, COUNT(monolingua) AS monolingua_count FROM dictionary WHERE english='$englishinput' GROUP BY monolingua ORDER BY monolingua_count DESC LIMIT 5";
$result=mysql_query($query) or exit(mysql_error());
while ($row=mysql_fetch_assoc($result))
{
echo $row['monolingua_count'] . ' ' . $row['monolingua'] . '<br>';
}
The output looks like this:
23 ALO
20 ALOHA
12 HOLA
9 HELLO
7 CIAO
I am trying to replicate the above php script in an html table to add additional formatting like color, resizing, etc. to the output. My new script I wrote is listed below:
<table width="300" height="100" border="1">
<tr>
<td>Count</td>
<td>MONOLINGUA</td>
</tr>
<?php
//This script queries greetings data and lists the top 5.
$englishinput=mysql_real_escape_string($_POST['englishinput']);
$query="SELECT monolingua, COUNT(monolingua) AS monolingua_count FROM dictionary WHERE english='$englishinput' GROUP BY monolingua ORDER BY monolingua_count DESC LIMIT 5";
$result=mysql_query($query) or exit(mysql_error());
while ($row = mysql_fetch_assoc($result)); ?>
<tr>
<td><?php echo $row['monolingua_count']; ?></td>
<td><?php echo $row['monolingua']; ?></td>
</tr>
</table>
For some reason the title headers appear in the table but the data doesn't list at all. I'm not getting any error msgs just not getting any data either just a blank table.