I have a simple search, where users can query on a players last name, but I want to add something to the search results.
Right now it displays, the player with a link to his profile, but I want to add the team name after...Like this:
Player Name, Team Name
Heres the meat of my results page:
if ($lname == "")
{$lname = '%';}
$result = mysql_query ("SELECT fname, lname, player_id
FROM players
WHERE lname LIKE '%$lname%'
",$conn);
if ($row = mysql_fetch_array($result)) {
$fname = $row['fname'];
$player_id = $row['player_id'];
$nflteamname = $row['nflteam_name'];
do {
PRINT "Search Results: <br><br>";
PRINT "<b>Player: </b> ";
echo " <a href='/football/players.php?player_id=" . $player_id . "'> ".$fname."
".$lname."</a>", "".$nflteamname."";
print (" ");
print ("<br>");
print ("<p>");
print ("<p>");
} while($row = mysql_fetch_array($result));
} else {print "Sorry, no records were found!";}
?>
This is the query for the NFL team name, but I'm just having trouble working it in...
SELECT players.nflteams_id, nflteam_name, player_id
FROM players, nflteams
WHERE nflteams.nflteam_id = players.nflteam_id
If you want to try it out....search for the name "Kennison" here
http://www.fantasyfootballresearch.com/football/search.php