php help :<
#1

I have mysql for over a month and i would like to create a top 5 players for on my website.

I hope somebody can help me with this.
Reply
#2

You can create something by your description by using the ORDER BY SQL syntax. Here's an example of how it's used if you don't understand the given link.

PHP код:
$order_query mysql_query"SELECT * FROM `accounts` ORDER BY `kills` LIMIT 5" );
while(
$order_fetch mysql_fetch_assoc$order_query ) )
       echo( 
$order_fetch['username'] . ":" $order_fetch['kills'] . " kills. <br />" ) ; 
Reply
#3

PHP код:
$order_query mysql_query"SELECT * FROM `accounts` ORDER BY `kills` DESC LIMIT 5" );
while(
$order_fetch mysql_fetch_assoc$order_query ) )
       echo( 
$order_fetch['username'] . ":" $order_fetch['kills'] . " kills. <br />" ) ; 
Reply
#4

Quote:
Originally Posted by [L3th4l]
Посмотреть сообщение
PHP код:
$order_query mysql_query"SELECT * FROM `accounts` ORDER BY `kills` DESC LIMIT 5" );
while(
$order_fetch mysql_fetch_assoc$order_query ) )
       echo( 
$order_fetch['username'] . ":" $order_fetch['kills'] . " kills. <br />" ) ; 
Ah, thank you very much for picking that up. I didn't notice I missed a important keyword in the syntax.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)