you should return value not echo
PHP Code:
$query = "SELECT team_id, win, loss FROM match_results WHERE season_id=12";
$result = mysql_query($query);
$output = "<table>";
while($row = mysql_fetch_array($result)){
$output .= "<tr><td>" . $row['Team'] . "</td><td>" . $row['Wins'] . "</td><td>" .$row['Losses'] . "</td></tr>";
}
$output .= "</table>";
return $output;
you should also avoid using the depreciated MySQL extension , you can use vBulletin database class.
for example
PHP Code:
$myquery = vB::$db->query_read("SELECT team_id, win, loss FROM match_results WHERE season_id=12");