[PHP-DB] Selecting last record only

2004-01-21 Thread -{ Rene Brehmer }-
Hi gang this is probably ridicously simple, but I'm new at this SQL stuff, so am a bit stumped. It's pretty simple: how do I get only the last record from a single table? Trying to convert my file-based website into DB-based, but can't quite figure out how to do this simple task. Table name is

Re: [PHP-DB] Selecting last record only

2004-01-21 Thread Micah Stevens
Reverse the order and limit the result to 1. For example, change: SELECT date, item from some_table To: Select date, item from some_table ORDER BY date DESC LIMIT 1 to get the latest dated item. -Micah On Wed January 21 2004 11:49 am, -{ Rene Brehmer }- wrote: Hi gang this is probably

Re: [PHP-DB] Selecting last record only

2004-01-21 Thread -{ Rene Brehmer }-
thx a bunch :) ... figured it would be something simple ... :p Rene Fate would have it, that on Wed, 21 Jan 2004 11:55:23 -0800, Micah Stevens wrote: Reverse the order and limit the result to 1. For example, change: SELECT date, item from some_table To: Select date, item from some_table