From the course: Ajax with PHP: Add Dynamic Content to Websites

Unlock the full course today

Join today to access over 23,100 courses taught by industry experts.

Calculate results

Calculate results

- [Instructor] In this movie, we will write the code to determine which suggestions to return and send them back as json. We should talk a bit about the kind of data that we want to use for our autosuggest. Autosuggest works best when we have large data sets, certainly, over 100 records. It works even better if there's 500 or 1,000, or even more. And that makes sense. There's no reason to make suggestions if we only have a handful of records to pull suggestions from. In our case, we know that we're going to need data that contains more than one suggestion when we provide it the first three characters. It's not very useful to have autosuggest if when we provide the first three characters, it either returns no results or only one result. It's going to be better if it can return multiple suggestions when we give it three characters. In the real world, the kind of data that you could use might be product names, maybe it's a database of your customers, or it's article titles. You could…

Contents