Jump to content

Archived

This topic is now archived and is closed to further replies.

elementz

How To Get The Newest Info Inputed Into MySQL

Recommended Posts

How do I show the newest ten table rows added to a MySQL database so I can show the 10 newest signed members that have signed up. Also how do I show the top ten points scored out of the members when one of the table rows is points. Please help me :D

Thankyou,
Luke

Share this post


Link to post
Share on other sites
Example:
[code]SELECT * FROM members ORDER BY id DESC LIMIT 10[/code]

Share this post


Link to post
Share on other sites
[quote author=hackerkts link=topic=101649.msg402431#msg402431 date=1153740371]
Example:
[code]SELECT * FROM members ORDER BY id DESC LIMIT 10[/code]
[/quote]

Does that get the 10 most newest members? also how do I get them by top ten points, say the points row is called points, how do I get the top ten members with the highest points?

Share this post


Link to post
Share on other sites
Use this quewry:
[code]SELECT * FROM members ORDER BY points_col ASC LIMIT 10[/code]
Change points_col to the name of you field that stores the points, it fetches the top tend highest scores from the database.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.