RE: [PHP-DB] Log Application Help...

2002-08-13 Thread Beau Lebens

Scott, can you just do it by sorting your query, then limiting the results
to 10?

ie.

SELECT * FROM tables WHERE somthing='1' ORDER BY date DESC LIMIT 10

should sort highest -> lowest date (ie most recent, backwards) and give you
the top 10 results. then if you have the option of flipping thru blocks of
10 results you can just change the last bit to

LIMIT x,10

WHERE x is a starting point, then 10 obviously getting the next 10 entires.

HTH

Beau

// -Original Message-
// From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED]]
// Sent: Wednesday, 14 August 2002 12:07 AM
// To: '[EMAIL PROTECTED]'
// Subject: [PHP-DB] Log Application Help...
// 
// 
//  I have a Log Application that is fully functional, but I need to
// change a behavior and can't quite figure out how.  This app 
// has three pages,
// one for entering new entries, one to display all entries for 
// the last 5
// days, and the final page allows updating of existing 
// entries.  The problem I
// am having is that the log display page displays the data 
// ordered by date and
// displays the oldest data first.  I want the data ordered 
// this way, but I
// would like it to default to the last page such that you see 
// the most recent
// entry first.  The log displays 10 entries per page, and I 
// just want it to
// default to displaying the last page rather than the first.  
// Below is what I
// think are the pertinent sections of code.  Please let me 
// know what you
// think, and if you need more information or code.  Thanks in 
// advance for the
// assistance.
// 
// 
// 
// 
// ...  A bunch of HTML formatting snipped out...
// 
//   
// Records  to  
// of  
// 
//
//   0) { // Show
// if not first page ?>
//   ">First 
//
//   0) { // Show
// if not first page ?>
//   ">Previous 
//
//  
//   ">Next 
//
//  
//   ">Last 
//
//   
// 
// 
// ...Cut of the rest of the HTML junk...
// 
// Scott Nipp
// Phone:  (214) 858-1289
// E-mail:  [EMAIL PROTECTED]
// Web:  http:\\ldsa.sbcld.sbc.com
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Log Application Help...

2002-08-13 Thread NIPP, SCOTT V (SBCSI)

I have a Log Application that is fully functional, but I need to
change a behavior and can't quite figure out how.  This app has three pages,
one for entering new entries, one to display all entries for the last 5
days, and the final page allows updating of existing entries.  The problem I
am having is that the log display page displays the data ordered by date and
displays the oldest data first.  I want the data ordered this way, but I
would like it to default to the last page such that you see the most recent
entry first.  The log displays 10 entries per page, and I just want it to
default to displaying the last page rather than the first.  Below is what I
think are the pertinent sections of code.  Please let me know what you
think, and if you need more information or code.  Thanks in advance for the
assistance.




...  A bunch of HTML formatting snipped out...

  
Records  to  of  

   
  0) { // Show
if not first page ?>
  ">First 
   
  0) { // Show
if not first page ?>
  ">Previous 
   
 
  ">Next 
   
 
  ">Last 
   
  


...Cut of the rest of the HTML junk...

Scott Nipp
Phone:  (214) 858-1289
E-mail:  [EMAIL PROTECTED]
Web:  http:\\ldsa.sbcld.sbc.com



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php