SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Wizard
    Join Date
    Dec 2004
    Location
    At My Desk!!
    Posts
    1,642
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Counting Rows in MySQL

    Now that ive got my next and previous buttons sorted i need to be able to count how many rows are in the database table so i know when to have the previous button dissapear and same with the next. Has anyone got any idea on how i can do this??

    p.s ive tried using SELECT COUNT in sql but cant seem to get it to return anything
    "Am I the only one doing ASP.NET in Delphi(Pascal)?"

  2. #2
    SitePoint Zealot deregular's Avatar
    Join Date
    Oct 2004
    Location
    australia
    Posts
    152
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think this is what you're after.
    Mysql_num_rows
    SEO Resources | SEO Software
    Web Directory < Submit your site free!

  3. #3
    SitePoint Wizard
    Join Date
    Dec 2004
    Location
    At My Desk!!
    Posts
    1,642
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yeh that counts the rows but i need a way of having an if statement saying that

    if no more rows the next button is not displayed, thats the kinda thing im after
    "Am I the only one doing ASP.NET in Delphi(Pascal)?"

  4. #4
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,804
    Mentioned
    157 Post(s)
    Tagged
    3 Thread(s)
    Morning!
    You need to take the total row count and in your pagination script find your final offset, when that equals the row row count you know you are on the last page.
    If you post your pagination code it will be helpful!

    SpikeZ
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  5. #5
    SitePoint Wizard
    Join Date
    Dec 2004
    Location
    At My Desk!!
    Posts
    1,642
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    notice my name webnoob

    Sooo what s pagination
    "Am I the only one doing ASP.NET in Delphi(Pascal)?"

  6. #6
    Free Geek computerages's Avatar
    Join Date
    Oct 2004
    Location
    /dev/null
    Posts
    1,071
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by webnoob
    notice my name webnoob

    Sooo what s pagination
    Google is your friend!

  7. #7
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,804
    Mentioned
    157 Post(s)
    Tagged
    3 Thread(s)
    pagination is the way of going
    < 1 | 2 | 3 > etc.....

    Posh way of saying paging!
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  8. #8
    SitePoint Wizard
    Join Date
    Dec 2004
    Location
    At My Desk!!
    Posts
    1,642
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it seems that i have come to rely on sitepoint a little tooo much and forgotton how to use a search engine :P :P
    "Am I the only one doing ASP.NET in Delphi(Pascal)?"

  9. #9
    SitePoint Wizard
    Join Date
    Dec 2004
    Location
    At My Desk!!
    Posts
    1,642
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    im gonna look through this tutorial that was on google and see how i get on, ill keep you posted (no pun intended ) thansk for the help
    "Am I the only one doing ASP.NET in Delphi(Pascal)?"


Bookmarks

Posting Permissions

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