PHP_Idiot Posted October 30, 2009 Share Posted October 30, 2009 I have a table that displays the combined results of two mysql queries after performing some additional maths calculations. The table displays players results from various venues and their relevant score. However, I need to only show the players best venue and points, not every venue they play in. Because an important part of the calculation is done in php AFTER the mysql queries have run, I need to limit the display of the array to only the unique players (by membership number). Earlier today I stumbled across some code examples of the use of DISTINCT in php script (not in mysql query) but I can't find it again now! Can anyone help? cheers Quote Link to comment https://forums.phpfreaks.com/topic/179662-solved-is-there-a-php-equivelent-to-the-mysql-distinct-command/ Share on other sites More sharing options...
Maq Posted October 30, 2009 Share Posted October 30, 2009 You can use array_unique but it's much more efficient to do it in MySQL whenever possible. Quote Link to comment https://forums.phpfreaks.com/topic/179662-solved-is-there-a-php-equivelent-to-the-mysql-distinct-command/#findComment-947975 Share on other sites More sharing options...
PHP_Idiot Posted October 30, 2009 Author Share Posted October 30, 2009 Perfect that's what I saw earlier but couldn't remember the syntax. Thanks a lot Quote Link to comment https://forums.phpfreaks.com/topic/179662-solved-is-there-a-php-equivelent-to-the-mysql-distinct-command/#findComment-948068 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.