how to display data from same query on diffrent pages using next link????

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • vishal

    how to display data from same query on diffrent pages using next link????

    when i run query i am getting thousands of records and i am displayaing
    a particular no. of records on a single page say 100 records then i put
    a link to go on next page. when user clicks on next page the another
    100 records will be displayes so should i need to run the query again
    to get records from 100 to 200 records ?????

    thxs for help in advance.

  • Craig Keightley

    #2
    Re: how to display data from same query on diffrent pages using next link????

    you need to add a limit to your sql
    <?
    if(!isset($minQ uery) || ($minQuery < 0)){
    $minQuery = "0";
    }
    if(!isset($maxQ uery)){
    $maxQuery = "100";
    }
    $sql = "SELECT * FROM table";
    $sql .= " LIMIT ".$minQuery .", ".$maxQuery ";



    ?>


    on your link to a page add ?minQuery=<? echo $minQuery-100; ?>&maxQuery=<?
    echo $maxQuery + 100; ?>


    hth
    craig



    "vishal" <vishal_panjabi @yahoo.co.in> wrote in message
    news:1113994018 .653635.95310@z 14g2000cwz.goog legroups.com...[color=blue]
    > when i run query i am getting thousands of records and i am displayaing
    > a particular no. of records on a single page say 100 records then i put
    > a link to go on next page. when user clicks on next page the another
    > 100 records will be displayes so should i need to run the query again
    > to get records from 100 to 200 records ?????
    >
    > thxs for help in advance.
    >[/color]


    Comment

    • Ewoud Dronkert

      #3
      Re: how to display data from same query on diffrent pages using next link????

      On 20 Apr 2005 03:46:58 -0700, vishal wrote:[color=blue]
      > to get records from 100 to 200 records ?????[/color]

      http://dev.mysql.com/doc/mysql/en/select.html and use LIMIT.


      --
      Firefox Web Browser - Rediscover the web - http://getffox.com/
      Thunderbird E-mail and Newsgroups - http://gettbird.com/

      Comment

      • Tim Van Wassenhove

        #4
        Re: how to display data from same query on diffrent pages using next link????

        On 2005-04-20, vishal <vishal_panjabi @yahoo.co.in> wrote:[color=blue]
        > when i run query i am getting thousands of records and i am displayaing
        > a particular no. of records on a single page say 100 records then i put
        > a link to go on next page. when user clicks on next page the another
        > 100 records will be displayes so should i need to run the query again
        > to get records from 100 to 200 records ?????[/color]

        Use the keyword "pagination " for your next websearch.

        --
        Met vriendelijke groeten,
        Tim Van Wassenhove <http://www.timvw.info>

        Comment

        • vishal

          #5
          Re: how to display data from same query on diffrent pages using next link????

          can you tell me more about pagination. i don't know what u want to say
          me by word pagination

          Comment

          • Tony Marston

            #6
            Re: how to display data from same query on diffrent pages using next link????

            Take a look at http://www.tonymarston.co.uk/php-mysql/pagination.html

            --
            Tony Marston

            This is Tony Marston's web site, containing personal information plus pages devoted to the Uniface 4GL development language, XML and XSL, PHP and MySQL, and a bit of COBOL



            "vishal" <vishal_panjabi @yahoo.co.in> wrote in message
            news:1114149304 .367807.205780@ f14g2000cwb.goo glegroups.com.. .[color=blue]
            > can you tell me more about pagination. i don't know what u want to say
            > me by word pagination
            >[/color]


            Comment

            • R. Rajesh Jeba Anbiah

              #7
              Re: how to display data from same query on diffrent pages using next link????

              vishal wrote:[color=blue]
              > can you tell me more about pagination. i don't know what u want to[/color]
              say[color=blue]
              > me by word pagination[/color]

              'coz Tim Van Wassenhove thinks that you aren't aware the term used
              for that. All (smart) programmers use Google
              <http://www.google.com/>--only very few will find difficult in
              searching as they may not be knowing the right keyword. So, Tim
              provided you with the keyword that you have to use
              ("pagination ")--thinking that you're smart and use or at least will use
              Google.

              FWIW, <http://www.google.com/search?q=php+pa gination>

              --
              <?php echo 'Just another PHP saint'; ?>
              Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

              Comment

              Working...