Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 10 of 10
  1. #1
    Join Date
    Sep 2006
    Location
    Evanston, Illinois.
    Posts
    2,361
    Tokens
    0

    Latest Awards:

    Default while pagination

    PHP Code:
    <?php
    $sql 
    "SELECT * FROM NEWS";
    $query mysql_query($sql);

    $total mysql_num_rows($query);
    $maxnews 3;
    if(
    $total <= $maxnews)
    {
    //what do i put here??????
    }
    else{
    while(
    $result mysql_fetch_array($query)) {
    // echo news articles if total is no greater than 3
    }
    }
    ?>
    what do I put there?
    How could this hapen to meeeeeeeeeeeeeee?lol.

  2. #2
    Join Date
    Sep 2006
    Location
    Evanston, Illinois.
    Posts
    2,361
    Tokens
    0

    Latest Awards:

    Default

    I assume I would need to echo the top 3 articles, ordering by id ascending but how would I only display the page number once at the bottom, and calculate the pages...
    How could this hapen to meeeeeeeeeeeeeee?lol.

  3. #3
    Join Date
    Nov 2006
    Location
    Bradford
    Posts
    2,667
    Tokens
    99

    Latest Awards:

    Default

    im no genius when it comes to php...but im sure that the parts in orange are simply 'comments' for the writer of the script, and that they play no part in the execution of the script or function
    Rep Points: 1065
    Last Good Rep From: Cyndia
    Last Bad Rep From: someone too cowardly to leave their name



    The People I Trust:
    Royal, Cwmbran, base, :Jakey, Destiny, Laurae90, Evolution, Mik, deagle

  4. #4
    RedCrisps Guest

    Default

    Yeh, there just comments =)

  5. #5
    Join Date
    Sep 2006
    Location
    Evanston, Illinois.
    Posts
    2,361
    Tokens
    0

    Latest Awards:

    Default

    I put the echoing articles bit, because I can do that, and the other bit to signify where and what I need help with.
    How could this hapen to meeeeeeeeeeeeeee?lol.

  6. #6
    Join Date
    Mar 2008
    Posts
    173
    Tokens
    0

    Default

    That is not the way you do pagination.

    http://php.about.com/od/phpwithmysql...pagination.htm

  7. #7
    Join Date
    Sep 2006
    Location
    Evanston, Illinois.
    Posts
    2,361
    Tokens
    0

    Latest Awards:

    Default

    Can you put this chunky text you directedme to into a small literary cycle.
    How could this hapen to meeeeeeeeeeeeeee?lol.

  8. #8
    Join Date
    Dec 2007
    Posts
    273
    Tokens
    0

    Default

    Test the divs and found out

  9. #9
    Join Date
    Sep 2006
    Location
    Evanston, Illinois.
    Posts
    2,361
    Tokens
    0

    Latest Awards:

    Default

    Ivake, your theJOSH I know it, and sthu. Try doing this yourself, oh wait you can't.
    How could this hapen to meeeeeeeeeeeeeee?lol.

  10. #10
    Join Date
    Sep 2006
    Location
    Evanston, Illinois.
    Posts
    2,361
    Tokens
    0

    Latest Awards:

    Default

    Did it, close t.
    How could this hapen to meeeeeeeeeeeeeee?lol.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •