Ok, well I'm brining this thread back to life...one more problem with this...
Here's my query again..
$query = "SELECT lname, fname, rush_yd, player_id
FROM playerstats, players
WHERE playerstats.player_id = players.player_id AND week = '" . $week . "' ORDER by rush_yd DESC
LIMIT 20";
Note: Without querying for the player_id field...it does work, however...
I need to use the player_id field to pass in a url...like this:
echo " <tr bgcolor=\"$bgcolor\"><td><a href=\"/football/players/".$player_id."\"> ".$fname." ".$lname."</a></td>";
echo "<td align=\"center\">".$rush_yd."</td></tr>";
So, when adding "player_id" to the query, I get this error:
Column: 'player_id' in field list is ambiguous
I'm guessing that I'm getting this error since player_id is in both, player and playerstats, tables.
Any help as to how I can use the player_id field and avoid this error?