I have 2 database tables; athRosters with athletic players and their bios (height, weight, likes, hobbies, etc), and the athPast table lists players that no longer play with my community college but have moved on to Universities. They both have the column of ‘playerName’ in common. Some players are listed in both tables. Some are only listed in the athPast table.
I have figured out, using JOIN, how to show the data of those that are listed in both tables AND include a link to the bio page.
But now my problem is showing the rest of them; those in athPast and NOT show the ones that are listed in both (because then I get them twice).
I thought that if I used the athRosters.playerCollege which lists what college they transferred too on their bio page as a variable to filter then it would work but it doesn’t.Code:SELECT athPast.yearsPlayed, athPast.playerName, athRosters.playerName, athPast.conference, athPast.college, athRosters.playerCollege, athRosters.rostSport FROM athRosters LEFT JOIN athPast ON athRosters.playerName = athPast.playerName WHERE athRosters.playerCollege = '' AND athRosters.rostSport = '".$_GET['gp']."' ORDER BY athPast.yearsPlayed DESC";
If this is confusing, just let me know what else I need to provide.



Reply With Quote

Bookmarks