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? 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"; 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! 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 Link to comment https://forums.phpfreaks.com/topic/65917-solved-querying-limited-results/#findComment-329504 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.