Ajax Pagination Tutorial PHP MySQL Database Results Paged With JavaScript




Lesson Code: http://www.developphp.com/video/JavaScript/Ajax-Pagination-Tutorial-PHP-MySQL-Database-Results-Paged In this video lesson you can learn …

Original source


41 responses to “Ajax Pagination Tutorial PHP MySQL Database Results Paged With JavaScript”

  1. Why not just return exactly what you want to display on the page via your ajax request instead of having to parse the data using split and having the overhead of processing it via javascript? Is it to be generic in case you want to display it on a different page in a different manner? What do you recommend as a best practice when returning data? What about a json array? Thanks 🙂 

  2. echo and not return? That threw me a bit; I did not understand a returning statement could be done this way. It is cool to know.  Is there something I am missing or is this just an example to show an alternate way to return data?

  3. pagination needs to stop existing.

    it's annoying for users.
    1) you can't ctrl+f search the article
    2) page loading becomes an issue
    3) page number links are usually very small, and hardly ever done right.
    4) increases server load (people who do need to go back to pages will make requests multiple times for a page they already loaded before.
    5) adds complexity, filesize, and development time

    The result? something negative.
    If possible avoid pagination.
    Don't ever paginate articles. everyone hates that.
    Paginating for search results makes sense.

  4. that is needed if someone brake into this page and see the whole bit of data that is parsed out of this php file let me explain better 😀 :

    when echoing the data everyone who managed to get to this file will see the data that is echoed so when use exit() function after the echo when you load the page you will see a blank page and no one will see the data except for the javascript function that is calling the php file ;]

    Do you understood me ?

  5. auto loop the ajax pagination just by adding this bet of code inside the function request_page(pn).

    if(pn > (last — —- 1)){
    pn = 0;
    }
    pn++;
    loopTimer = setTimeout('request_page('+pn+')',30000);

    ASk the Teacher -:)

Leave a Reply