Add to delicious
Add to technorati
Add to technorati
Digg it
furl
Yahoo

Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthormaxtuska
    • CommentTimeOct 12th 2009 edited
     # 1

    Hello masters!

    I am total newbie in database-queries and stuff.

    I have tried to understand how to limit entries on my page.

    1. If i want to show only 5 entries on my index.php and add pagination after that. How do i do that?
    2. How can i get entries on my index.php so that the newest will be first.

    This is the code i have at the moment to get the news entries.


    <?php
    $getNews= $Db->select(TABLE_PREFIX . "news");
    while($news = mysql_fetch_assoc($getNews))
    {
    echo '<h3>' . $news['title_txt'] . '</h3>';
    echo date('d/m/y',$news['date_date']);
    echo $news['body_txtbox'];
    }
    ?>

    Thanks in advance.