Canadiengland Posted August 21, 2007 Share Posted August 21, 2007 $selectuser="SELECT * from km_users order by pkpoints ASC"; $selectuser2=mysql_query($selectuser) or die("could not select item"); while($selectuser3=mysql_fetch_array($selectuser2)) { print "<br>$selectuser3[playername]<br><br>"; } i want this to return only the top 5 of the list. how can i limit the query? Quote Link to comment https://forums.phpfreaks.com/topic/65917-solved-querying-limited-results/ Share on other sites More sharing options...
teng84 Posted August 21, 2007 Share Posted August 21, 2007 $selectuser="SELECT * from km_users order by pkpoints desc limit 5"; Quote Link to comment https://forums.phpfreaks.com/topic/65917-solved-querying-limited-results/#findComment-329499 Share on other sites More sharing options...
Canadiengland Posted August 21, 2007 Author Share Posted August 21, 2007 aha knew it was something easy - havent been at this in a while - thanks teng! Quote Link to comment https://forums.phpfreaks.com/topic/65917-solved-querying-limited-results/#findComment-329501 Share on other sites More sharing options...
teng84 Posted August 21, 2007 Share Posted August 21, 2007 mark this as solved Quote Link to comment https://forums.phpfreaks.com/topic/65917-solved-querying-limited-results/#findComment-329504 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.