Jump to content


Photo

How To Get The Newest Info Inputed Into MySQL


  • Please log in to reply
4 replies to this topic

#1 elementz

elementz
  • Members
  • PipPipPip
  • Advanced Member
  • 36 posts

Posted 24 July 2006 - 11:22 AM

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

#2 hackerkts

hackerkts
  • Members
  • PipPipPip
  • Advanced Member
  • 593 posts
  • LocationSingapore
  • Age:18

Posted 24 July 2006 - 11:26 AM

Example:
SELECT * FROM members ORDER BY id DESC LIMIT 10


Regards,
hackerkts

To be a coder, you must learn how to think and not to give up so easily.


#3 elementz

elementz
  • Members
  • PipPipPip
  • Advanced Member
  • 36 posts

Posted 24 July 2006 - 11:34 AM

Example:

SELECT * FROM members ORDER BY id DESC LIMIT 10


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?

#4 hackerkts

hackerkts
  • Members
  • PipPipPip
  • Advanced Member
  • 593 posts
  • LocationSingapore
  • Age:18

Posted 24 July 2006 - 11:35 AM

Can you post your table structure ?

Regards,
hackerkts

To be a coder, you must learn how to think and not to give up so easily.


#5 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 24 July 2006 - 11:57 AM

Use this quewry:
SELECT * FROM members ORDER BY points_col ASC LIMIT 10
Change points_col to the name of you field that stores the points, it fetches the top tend highest scores from the database.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users