Well, you gotta think ahead a little in order to put the results into a table. This used to seem really confusing when I just learned this, but it's actually quite easy.
The while loop repeats, right? So you don't want to have your table tag inside of the while loop, or else you're going to get as many tables as you have results. You also don't want your </table> tag within your while loop, or you'll have as many of those as you have results.
You want to put your <table> tag before the while loop, and your </table> tag outside of your while loop, in order to put all the results in one table. Your setup would look something like this
echo "<table width=\"600\">\n";
while($row = mysql_fetch_array($query)) {
echo "<tr>\n";
echo "<td width=\"200\"><b>Name</b></td>\n";
echo "<td width=\"200\"><b>Email</b></td>\n";
echo "<td width=\"200\"><b>AIM</b></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td width=\"200\">" . $row["name"] . "</td>\n";
echo "<td width=\"200\">" . $row["email"] . "</td>\n";
echo "<td width=\"200\">" . $row["aim"] . "</td>\n";
echo "</tr>\n";
}
echo "</table>\n";
Cgraz