Question

  • Creator
    Topic
  • #2136301

    Add Page number to website for Product page?

    Locked

    by raj1225 ·

    Hi there,
    i am designing my own site. i was stuck with product page.
    i need to add page number for product page.
    i have more number of product. i want to use page number to show the list of product. i need to display 5 item per page. i want link prev and next alone.
    i am using html, js, css and mysql.
    please show me a example with code.
    Thanx
    With regards,
    Raj

All Answers

  • Author
    Replies
    • #2903036

      Clarifications

      by raj1225 ·

      In reply to Add Page number to website for Product page?

      Clarifications

    • #2903016

      MySQL Queries and PHP…

      by sven2157 ·

      In reply to Add Page number to website for Product page?

      What you seek is not as simple as it would seem. If you took the time to Google this, instead of posting a generic question, with a request for code, you are most likely not going to learn from; rather copy and paste, then you would have found many, many examples.

      However, if you would like to actually learn this, then you need to focus on a more dynamic language for your shopping cart. I suggest PHP, as it is the easiest to use. When creating pages of product, you must query the database for ALL products. When the query returns, you have a ‘results’ number( i.e. the total amount of products in the DB ). This is used to calculate the total number of pages that will be needed.

      To display five results on the page, another query of the database is needed, but with a LIMIT of five. Your ‘next’ button, would then be the same query, plus five. This then lists the next five, while your ‘previous’ button is the same, but minus five.

      As you can see this gets pretty complicated, pretty fast.

      See the following links:

      [url=http://lmgtfy.com/?q=PHP+Pagination]PHP Pagination[/url]
      [url=http://w3schools.com/php/default.asp]W3 Schools PHP[/url]

      … Start there, and if you have [b][u]specific[/u][/b] questions about PHP or Pagination, then post what you are not understanding.

      Sven2157

      • #2903009

        Reponse To Answer

        by jqbecker ·

        In reply to MySQL Queries and PHP…

        Sven,
        I’m with you. Too many folks in these forums wont do the bare minimum to find answers themselves, they just want a complete program handed to them.

Viewing 1 reply thread