Welcome Guest, Not a member yet? Register   Sign In
Ordering DB results by date
#1

[eluser]patrick-vibes[/eluser]
Hi,

I am trying to order my results by date to show latest portfolio items limited to 10 order by most recent.

The code I have to retrieve the results, that works fine is:

Code:
$data['query'] = $this->db->get('portfolio' , 10);

but am am not sure how to order this by date - whether I need to use the more convoluted PHP way like SELECT from ORDER BY date or if something like this is the better way:

Code:
$data['query'] = $this->db->get('portfolio' , 10);
$data['query'] = $this->db->orderby("date", "ASC");

I know it might be a simple question but I have had a good trawl through the userguide and forum and can not find a simple answer.

Thanks in advance.


Messages In This Thread
Ordering DB results by date - by El Forum - 07-31-2008, 10:37 AM
Ordering DB results by date - by El Forum - 07-31-2008, 10:40 AM
Ordering DB results by date - by El Forum - 07-31-2008, 10:54 AM
Ordering DB results by date - by El Forum - 07-31-2008, 10:58 AM
Ordering DB results by date - by El Forum - 07-31-2008, 11:07 AM
Ordering DB results by date - by El Forum - 07-31-2008, 11:14 AM
Ordering DB results by date - by El Forum - 07-31-2008, 11:26 AM
Ordering DB results by date - by El Forum - 07-31-2008, 12:10 PM
Ordering DB results by date - by El Forum - 08-01-2008, 12:02 AM



Theme © iAndrew 2016 - Forum software by © MyBB