I can't figure out why PHP outputs lines before the HTML is generated. I created a table, and tried to output some values into table rows, but the PHP values are displayed above the table instead of within the table rows. Any way I can tweak this?
My code looks like this.
function printList($query)
{
//get recruits from database
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
// print the list
while(list($id, $lname, $fname, $email) = mysql_fetch_row($result))
{
print "<li>$fname $lname email: $email<BR>";
}
}
Then I would create a table and call the function:
<table>
<tr>
<td><b><font face="Arial"><img src="x.gif">Full-time Recruits </font></b></td>
</tr>
<ul>
<?
// get list of full-time recruits
$query = "SELECT * from recruits WHERE recruits.type = 'FT'";
printList($query);?>
</ul>
</table>
Thanks,
Dare