Go Back   Dynamic Drive Forums > General Coding > MySQL and other databases
Search Dynamic Drive Forums:

Reply
 
Thread Tools Search this Thread
  #1  
Old 09-28-2009, 05:47 PM
fobos fobos is offline
Junior Coders
 
Join Date: Oct 2008
Posts: 38
Thanks: 2
Thanked 4 Times in 4 Posts
Default Mysql problem

Hello All,
i am having a HUGE mental block right now. ok here it is.
i have a database where everthing in it gets displayed.
|id|product_name|filename|
1 crap something.ppt

2. everyday, (1) new product will be added to the database. now i want to display all rows, minus the latest one, because that will be listed above. So here is an example. Say today is the 25th
[this is one database]

Todays current news
Link... <-- 25th statement used (SELECT * FROM db ORDER BY id LIMIT 1)

Archived News statement used
(SELECT * FROM db ORDER BY id "SOMETHING FOR MINUS 1")
________________________
crap download <-- 24th
crap download <-- 23th

and so forth...

is there a statement to display all minus the lates entry..
if this is confusing, please let me know..
Reply With Quote
  #2  
Old 11-04-2009, 09:23 PM
james438 james438 is offline
Senior Coders
 
Join Date: Jan 2007
Location: Iowa
Posts: 383
Thanks: 17
Thanked 9 Times in 9 Posts
Default

If it were me I would add a datetime column for the entries.
Code:
Select * from tablename order by ID desc limit 1,99999999
the above sounds like what you are looking for.
__________________
To choose the lesser of two evils is still to choose evil.

Last edited by james438; 11-11-2009 at 01:15 AM.
Reply With Quote
The Following User Says Thank You to james438 For This Useful Post:
fobos (11-13-2009)
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:42 AM.

Home - Contact Us - Archives - Link to DD - Top 

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.