latest entry in multiple tables
Moderator: General Moderators
-
marthaller
- Forum Newbie
- Posts: 3
- Joined: Wed Mar 31, 2010 6:34 am
latest entry in multiple tables
I've just designed a website that hosts a tri-weekly comic and blog posts by two people. On the homepage I have the latest comic, and latest post by each person. what I want to do is put the most recent one of each in order of date on the page. it's easy with the blog, as the layout is the same in each, but integrating it with the comic I"m having trouble with. can anybody help. thanks.
Re: latest entry in multiple tables
If you're using a query, then normal a simple "order by [fieldnameholdingdate]" should suffice to sort each in date order.
-
marthaller
- Forum Newbie
- Posts: 3
- Joined: Wed Mar 31, 2010 6:34 am
Re: latest entry in multiple tables
thanks or the quick reply. I have no trouble getting the entry, but when I have these three entries, there are two different formats dopending on if it's a comic of blog entry. that's what I'm trying to figure out. thanks
Re: latest entry in multiple tables
What roders posted has nothing to do whether you have trouble getting the entry... its an SQL update to sort by the most recent entry by date.marthaller wrote:thanks or the quick reply. I have no trouble getting the entry, but when I have these three entries, there are two different formats dopending on if it's a comic of blog entry. that's what I'm trying to figure out. thanks
Although it should read:
Code: Select all
SELECT * FROM `yourTable` ORDER BY `dateTime` DESCHowever.. you have not indicated any sort of table structure for your comics/blog nor have you provided any code for us so that we have a bone to play with, so its slightly difficult to give you a 100% correct solution.