i think you are using ajax ... which undoubdetly uses an sql database since its based on queries run from whithin the application in the browser whithout the need for refreshing the page ... i would suggest you try serching internet for something like "google autocomplete feature" & i guess the queries are also no that long they have a limit of the results ... for example not more than 20 results per query.
than said there would be no loop. just a query (with a limit of 20 rersults) each time a use inputs a character. hope this helps.
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor