Posts Tagged ‘Live Search’

Live MySQL Database Search with jQuery

Thursday, March 19th, 2009

Live search is starting to become more and more mainstream. With the advent of Ajax the ability to carry out searches without leaving the page have obviously started to appear more and more. The trouble with live searching though, is it can be quite resource intensive. Every keystroke in theory returns a bunch of search results, perhaps relevant, perhaps not. On a busy site this could have quite an impact.

In this tutorial I will demonstrate the same basic theory, live searching (demo) – however I am not showing the user any results until they execute the search. Instead, I am responding with a search result count in a live manner (after every key stroke), but actually returning the results on a button click or [ENTER] key press.

Live MySQL searching with jQuery

Live MySQL searching with jQuery (Click for demo)

What this does is cut down on the amount of data whizzing around after every keystroke, cutting down database activity and more importantly bandwidth reduction. It also gives the user some relevant feedback on their search so they can see if their search term actually matches any results in the first place before submitting it in a very economical fashion.

Click Here For Demo

(more…)