Jump to content


Photo

* Solved* Select last 3 records from db


  • Please log in to reply
2 replies to this topic

#1 Gruzin

Gruzin
  • Members
  • PipPipPip
  • Advanced Member
  • 448 posts
  • LocationGeorgia

Posted 09 October 2006 - 08:48 PM

Hi guys,
I am making a registration form, so I need to show last 3 members from db. Any ideas how to do that?

Thanks for your time,
George
I don't need your script, I'll try to write it myself

#2 obsidian

obsidian
  • Staff Alumni
  • Advanced Member
  • 3,202 posts
  • LocationSeattle, WA

Posted 09 October 2006 - 08:50 PM

do you have a date field for the time they signed up? if so, it's as simple as ordering by that field:
SELECT * FROM users ORDER BY signupDate DESC LIMIT 3;

You can't win, you can't lose, you can't break even... you can't even get out of the game.

<?php
while (count($life->getQuestions()) > 0)
{   $life->study(); } ?>
  LINKS: PHP: Manual MySQL: Manual PostgreSQL: Manual (X)HTML: Validate It! CSS: A List Apart | IE bug fixes | Zen Garden | Validate It! JavaScript: Reference Cards RegEx: Everything RegEx

#3 Gruzin

Gruzin
  • Members
  • PipPipPip
  • Advanced Member
  • 448 posts
  • LocationGeorgia

Posted 09 October 2006 - 08:52 PM

Not yet, I will add date field for that, thanks for quick answer  :)
I don't need your script, I'll try to write it myself




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users