Results 1 to 4 of 4

Thread: returning so much from a db

  1. #1

    Thread Starter
    Lively Member Brandito's Avatar
    Join Date
    Nov 2000
    Location
    Here, There, Every Where!
    Posts
    106

    returning so much from a db

    Hey.. I have a Database / PHP question... more sql than anything I am hoping.

    I have a number of records in a database. My SQL select statement will return 102 records and I want to display 50 of them at a time. There is a button and when that is pressed it will select the next 50 and display those... then the last 2.

    I didn't know if there was someway to tell the database you want the first 50 records... or the 50th record through the 100th record recieved. My unique key is not numberic so I can't do any of those tricks.

    thanks,
    Brandon
    Master of Cyber Fu - A Temple of Digital Chi

  2. #2
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906
    If you are using a MySql database, you can use limit to obtain the result set you require:
    Code:
    SELECT whatever FROM whatever LIMIT 49,100
    Will return all records from number 50 to number 150.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  3. #3

    Thread Starter
    Lively Member Brandito's Avatar
    Join Date
    Nov 2000
    Location
    Here, There, Every Where!
    Posts
    106

    cool

    COOL! That is what I was looking for.

    I am using ODBC to connect to and ACCESS Database. Do you know if there is support for this?

    Thanks again,
    brandito
    Master of Cyber Fu - A Temple of Digital Chi

  4. #4
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906
    I'm not sure whther it will work. You are probably best asking that question in the Database forum.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width