buffering search results.....

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
runelore
Forum Commoner
Posts: 25
Joined: Thu Aug 22, 2002 10:14 am

buffering search results.....

Post by runelore »

Hi, here is what I want....
I wiant to make a search on the database using my search engine (i already have this). what I want to do is to have all the results returned and formated before I output it to the screen... I want this because when someone does a big search, the list populates while onscreen... what I want is to display "searching.." and then when the search is complete, display the results... I have tried ob_start and othe output buffering stuff but can't get it working. please help.... thanks for any help...
User avatar
protokol
Forum Contributor
Posts: 353
Joined: Fri Jun 21, 2002 7:00 pm
Location: Cleveland, OH
Contact:

Post by protokol »

This is not too difficult. Before you do the database lookups, put the "searching..." text before the loop which grabs all database values. Put the database lookup code inside a while loop where you would simply assign the results to some sort of associative array or object structure .... then after the while loop, create another bit of code which will loop through that code and print the results. This way the results are only displayed once you have found all of them.
runelore
Forum Commoner
Posts: 25
Joined: Thu Aug 22, 2002 10:14 am

Post by runelore »

cool, never thought of that one, thanks for the help...
Post Reply