SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Zealot stuffedbuggy's Avatar
    Join Date
    Sep 2008
    Posts
    187
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Arrow Display query results before all results are retrieved???

    I have a table with about 500,000 rows, not much I know.
    Is there any way to Display the results of the query as they are retrieved, instead of waiting till all the rows are returned and then displaying.
    I'm also using pagination at 10 entries per page. Max return is 150 rows. I'm using LIKE, and from what I've read, INDEXES don't support the LIKE claus. Any suggestions please??????
    You know you cooler than me...

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,492
    Mentioned
    161 Post(s)
    Tagged
    4 Thread(s)
    Are you going to display 500.000 rows in one page?

  3. #3
    SitePoint Zealot stuffedbuggy's Avatar
    Join Date
    Sep 2008
    Posts
    187
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    no that's just how large the table is... the max than can be displayed is 150 entries, at 10 rows per page for a total of 15 pages. What I would like is for the first page to be echo'd while the rest of the results are retrieved.
    You know you cooler than me...

  4. #4
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,492
    Mentioned
    161 Post(s)
    Tagged
    4 Thread(s)
    Why not retrieve only the 10 rows you're going to display. Do a search for 'pagination' here or google for it, and you'll find lots of help

  5. #5
    SitePoint Zealot stuffedbuggy's Avatar
    Join Date
    Sep 2008
    Posts
    187
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    see, i dont know which 10 rows will be displayed. the whole table must be scanned. but thanks for the help.
    You know you cooler than me...

  6. #6
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,492
    Mentioned
    161 Post(s)
    Tagged
    4 Thread(s)
    I see. I guess that's a problem, because as far as I know, MySQL gives controll back to the PHP script (assuming you use PHP ) after completion of the query.

    But... I'm curious... if you don't know what rows to show when you query the table, then how do you decide once the results come back to the script?

  7. #7
    SitePoint Zealot stuffedbuggy's Avatar
    Join Date
    Sep 2008
    Posts
    187
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it's all based on user input. check out my search engine. www.spongelink.com
    You know you cooler than me...

  8. #8
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    does your query use ORDER BY?
    Check out our new Industry News forum!
    Keep up-to-date with the latest SP news in the Community Crier

    I edit the SitePoint Podcast

  9. #9
    SitePoint Zealot stuffedbuggy's Avatar
    Join Date
    Sep 2008
    Posts
    187
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yes i use order by
    Code:
    SELECT t,d,r FROM table WHERE (t LIKE '%a%' AND 
    t LIKE '%b%' AND t LIKE '%c%' )OR (d LIKE '%a%' 
    AND d LIKE '%b%' AND d LIKE '%c%' )ORDER BY r
    You know you cooler than me...


Bookmarks

Posting Permissions

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