4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 MYSQL Query Help
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
Justin
4WebHelp Addict
4WebHelp Addict


Joined: 07 Jan 2002
Posts: 1060

PostPosted: Sun Jul 20, 2003 5:13 pm (21 years, 5 months ago) Reply with QuoteBack to Top

I have two Sections in my database, One for news, one for columns

I want a query to do the following :

Pull all of the latest articles (both news and columns) out of the database apart from the first news article.

The problem I have at the moment, is I'm using :

@$outcome=mysql_query("SELECT * FROM articles ORDER BY adate DESC,atime DESC LIMIT 1,9");
if ($sectionID) @$outcome=mysql_query("SELECT * FROM articles WHERE sectionID='$sectionID' AND adate<='$date' ORDER BY adate DESC, atime DESC LIMIT $articlenumber");

The trouble with that is, it pulls the latest articles, apart from the first one whether it is news or not, what I want is, for it to pull the latest articles out excluding the latest news article

For your info, each article has a column called sectionID, where the value is either 1 (News) or 2 (Column)
OfflineView User's ProfileFind all posts by JustinSend Personal MessageSend email
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.


Page generation time: 0.123347 seconds :: 17 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme