Help me in php-mysql "Next Button"

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Help me in php-mysql "Next Button"

    Hello
    i have to store data in different pages having next button on them
    suppose i have an image gallery and i have to display 10 images in a page according to different sorting like sorted in acs or dec order or sort by name etc.
    I just wanna consider each image as a single item and i wanna 10 items per page.
    for that i am able to make next button in sorting them by their id,but i am unable to make next button in sorting according to their names...
    can anybody help me????
    please help if you can...!!!!

    #2
    use search button of this forum and search for auto index script.. may be that works fot u

    Comment


      #3
      in you sql use


      Code:
      SELECT what.u.select FROM ur.table ORDER BY ur.name.column LIMIT ur.limit

      should order them by name
      Last edited by mFreak; 15.08.11, 10:19.
      PHP Code:
      $("#mfreak").find(".head brain").clone(); 
      Progress:
      Code:
      [|||___________________________] : 5%
      Output:
      Code:
      Memory limit reached, unable to complete operation.
      Support answer:
      Code:
      Try using a super uber strong mega computer to reach at least 10%.

      Comment


        #4
        Originally posted by mFreak View Post
        in you sql use


        Code:
        SELECT what.u.select FROM ur.table ORDER BY ur.name.column LIMIT ur.limit
        should order them by name
        yup that's what i am using
        select * from tableName order by name limit $limit
        but how to list second page's entries???
        i am not asking about how to list according to name
        but i wanna knoe how to arrange them with next button working fine

        Comment


          #5
          Use $_GET on button and switch() to query.
          <!DOCTYPE html PUBLIC "-//WAPFORUM.RS

          Comment


            #6
            Originally posted by arnage View Post
            Use $_GET on button and switch() to query.
            yea i used but what will be query???
            i passes page=1 , page=2 , page=3 and so on for $_GET
            problem is that i wanna 10 entries in a page
            when page=1 it shows entries from 1-10
            but how to display 11-20 for page=2
            and so on
            that is exactly what is problem

            Comment


              #7
              I meant another $_GET for sort, for example $sort = $_GET['sort'] and switch ($sort) { $sort ='acs' or dec ...
              and link page.php?page=2&amp;$sort='.$sort.' ...
              and query SELECT what.u.select FROM ur.table ORDER BY '.$sort.' LIMIT ur.limit
              That?
              Last edited by arnage; 15.08.11, 15:44.
              <!DOCTYPE html PUBLIC "-//WAPFORUM.RS

              Comment


                #8
                Originally posted by arnage View Post
                I meant another $_GET for sort, for example $sort = $_GET['sort'] and switch ($sort) { $sort ='acs' or dec ...
                and link page.php?page=2&$sort='.$sort.' ...
                and query SELECT what.u.select FROM ur.table ORDER BY '.$sort.' LIMIT ur.limit
                That?
                what about page.php?page=2????
                how will page=2 work???

                Added after 11 minutes:

                Originally posted by arnage View Post
                I meant another $_GET for sort, for example $sort = $_GET['sort'] and switch ($sort) { $sort ='acs' or dec ...
                and link page.php?page=2&$sort='.$sort.' ...
                and query SELECT what.u.select FROM ur.table ORDER BY '.$sort.' LIMIT ur.limit
                That?
                hmmm...
                listen
                i made a similar page with next button which is working fine
                there i sort entries according to their "id" which is int type
                for that i used "select * from tableName where id > $id_of_last_entry_in_previous_page limit $limit"
                ok?
                this way if you have to arrange 10 entries per page then for page=2 id will be greater than 10 i.e., id = 11 and limit will stop at 20 for page=2 and so on..
                but if i have to arrange them in a sorting order by their name then how can i get last entry of each page and how can i start next page's 1st entry exactly next from previous page's last entry?
                Last edited by ohimunda; 15.08.11, 16:45.

                Comment


                  #9
                  Post your code, i realy cant guess.

                  Originally posted by ohimunda View Post
                  ...
                  how can i get last entry of each page and how can i start next page's 1st entry exactly next from previous page's last entry?
                  Thats doing math and loop.
                  Last edited by arnage; 15.08.11, 19:10.
                  <!DOCTYPE html PUBLIC "-//WAPFORUM.RS

                  Comment


                    #10
                    Use pagination for this

                    Comment


                      #11
                      Originally posted by pichiriche View Post
                      Use pagination for this
                      any example?

                      Comment

                      Working...
                      X