[PHP-DB] Selct show certain num records ?

2002-01-30 Thread Dave Carrera

Hi All

I know this has been covered here before but can someone please remind
me how to selct just the 5 latest records in my db and show them in list
form.

Just like phpbuilder.com dose

I thank you in advance for repeating this information.

Dave C :-)



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Selct show certain num records ?

2002-01-30 Thread Shooter

$order=time desc;
$sql=SELECT * from $table ORDER BY $order LIMIT 0,5 or die (Cant do sql
$sql);;

that would get the latest news sorted on the time.

Neil

- Original Message -
From: Dave Carrera [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, January 31, 2002 5:54 PM
Subject: [PHP-DB] Selct  show certain num records ?


 Hi All

 I know this has been covered here before but can someone please remind
 me how to selct just the 5 latest records in my db and show them in list
 form.

 Just like phpbuilder.com dose

 I thank you in advance for repeating this information.

 Dave C :-)



 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]