I have a page that will not show the bottom half of my HTML after my PHP Code. The only way I could get it to show was to place a RETURN at the end of the WHILE Loop, which also ended the loop. I know it is probably something simple and just need to find out what it is. Thanks in advance for your help.
The HTML:
<table border='0'>
<thead>
<tr>
<th scope="cols">Select</th>
<th scope="cols">Name</th>
<th scope="cols">Units</th>
<th scope="cols">Amounts</th>
<th scope="cols">Calories</th>
<th scope="cols">Sugars</th>
</tr>
</thead>
<tbody>
<?php
//Establishs the DB connection
$sql = new Mysql();
//Queries the Foods
$sql->food();
?> <!--NOTHING SHOWS FROM HERE DOWN-->
</tbody>
</table>
<h2>Training Plan</h2>
<table id="dairy">
<thead>
<tr>
<th scope="cols">Select</th>
<th scope="cols">Name</th>
<th scope="cols">Units</th>
<th scope="cols">Amounts</th>
<th scope="cols">Calories</th>
<th scope="cols">Sugars</th>
</tr>
...more HTML....
The PHP Function:
function food() {
//Query's the DB
$result = $this->conn->query("SELECT * FROM ingredient") or die(mysql_error());
//Display's all of the Contents in the DB
while ($row = $result->fetch_assoc() or die(mysql_error()))
{
echo'<tr class="normal" id="row'.$row['id'].'" onclick="onRow(this.id);">'."\n\t\t\t\t\t\t\t".'<td><input type="checkbox" value="'.$row['id'].'" id="checkbox" /></td>'."\n\t\t\t\t\t\t\t";
echo'<td>'.$row['Name'].'</td>'."\n\t\t\t\t\t\t\t";
echo'<td>'.$row['Units'].'</td>'."\n\t\t\t\t\t\t\t";
echo'<td>'.$row['Amount'].'</td>'."\n\t\t\t\t\t\t\t";
echo'<td>'.$row['Calories'].'</td>'."\n\t\t\t\t\t\t\t";
echo'<td>'.$row['Sugar'].'</td>'."\n\t\t\t\t\t\t";
echo'</tr>'."\n\t\t\t\t\t\t";
}
}