Welcome Guest, Not a member yet? Register   Sign In
A really simple question
#11

[eluser]daulex[/eluser]
OMG, thank you thank you thank you Big Grin
#12

[eluser]gunter[/eluser]
:bug:
thanks Inparo!!!
#13

[eluser]daulex[/eluser]
awesome, it works Big Grin
ok, another question, I'm trying to make a list of titles with the dates, it works fine for me, if I do this:
function:
Code:
function index()
{
$data['query'] = $this->db->get('template');
$this->load->view('news',$data);
}
view:
Code:
<? foreach($query->result() as $row): ?>
<p>&lt;?=$row->title?&gt; (&lt;?=$row->date?&gt;)</p>
&lt;? endforeach;?&gt;

and it works fine and outputs:
Quote:My first post (2008-05-29)
Second test (2008-05-29)
Third test (2008-05-29)

Now, how can I re-arrange it? I would like the newer posts to be on the top and the older ones on the bottom, what do I need to do for that?

Thanks!
#14

[eluser]Pascal Kriete[/eluser]
Code:
$this->db->order_by("date", "DESC");
#15

[eluser]daulex[/eluser]
u rock dude Smile

Thanks, however I decided to order it by id, as if there are more than 1 news per a single date, they get ordered by id in ascending order Smile

Thank you Smile




Theme © iAndrew 2016 - Forum software by © MyBB