Caffeinenyx Posted May 6, 2011 Share Posted May 6, 2011 $PlayerQuery = "SELECT FirstName, SurName FROM players p, rounds m, entrants e, games t WHERE p.PlayerID = e.PlayerID AND m.GameID = '$ID' AND e.EntrantID = m.Player"; $PlayerResult = mysql_query($PlayerQuery); $PlayerRow = mysql_num_rows($PlayerResult); Can someone suggest why this returns game*the number of results. For each new game it returns an extra duplicate result. For example for 2 games: j Smith j Smith t John t John etc There are no duplicate entry's! and results should be unique. Not in a loop (positive) Quote Link to comment https://forums.phpfreaks.com/topic/235706-query-duplicate-results/ Share on other sites More sharing options...
MadTechie Posted May 6, 2011 Share Posted May 6, 2011 Because your pulling 2 rows, for example if i have 2 tables Table A has 1 record Table B has 3 records if i link them and display only for table A i would get the same result 3 times, change FirstName, SurName to * and review the details, without knowing my details about the database its kinda hard to say! but it's likely you are returning 2 more data that you need/want Quote Link to comment https://forums.phpfreaks.com/topic/235706-query-duplicate-results/#findComment-1211490 Share on other sites More sharing options...
Caffeinenyx Posted May 6, 2011 Author Share Posted May 6, 2011 * still returns game* results. First name etc is unique to rounds. Also none of them have the same number of results as game except game. Why game* results. It should only be looking a 1 game ID, which has say 8 people and entry ID's, hence 8 names. Quote Link to comment https://forums.phpfreaks.com/topic/235706-query-duplicate-results/#findComment-1211501 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.