Selection of records in list

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

    Selection of records in list

    Dear folks:

    I was wondering how to query MySQL to display only a selection (1-20,
    21-40) of a query in an HTML list. Can that be done in an SQL
    statement, or do you have to use PHP to dissect the returned array
    with for n elements to n+20 elements. How does Google achieve the
    returning of results in its search engine. I imagine that the same
    query may not necessarily be executed each page listing. I am
    wondering whether the results from the query would return an array of
    say 36000 elements.

    Regards,
    Jean Biver
  • Tony Marston

    #2
    Re: Selection of records in list

    jbiver@internet .lu (Jean Biver) wrote in message news:<f8dd7fe8. 0307232302.10d5 5b59@posting.go ogle.com>...[color=blue]
    > Dear folks:
    >
    > I was wondering how to query MySQL to display only a selection (1-20,
    > 21-40) of a query in an HTML list. Can that be done in an SQL
    > statement, or do you have to use PHP to dissect the returned array
    > with for n elements to n+20 elements. How does Google achieve the
    > returning of results in its search engine. I imagine that the same
    > query may not necessarily be executed each page listing. I am
    > wondering whether the results from the query would return an array of
    > say 36000 elements.
    >
    > Regards,
    > Jean Biver[/color]

    Read the MySQL manual at


    and check out the 'LIMIT [offset,] rowcount' option. This will do
    precisely what you want. I use it all the time.

    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

    Comment

    Working...