Interested in using the jQuery UI autocomplete feature to connect with a large MySQL database of events. Will this slow down each page significantly?(Search bar will be on all pages)
Should I store the results from the Query to Local Storage put the script at the bottom of the page? Or SESSION or Cookie?
Here is the code without any cache features.
<?php
require_once("../../connect.php");
$day_events = "SELECT * FROM tbl_events";
$events_result = mysql_query($day_events);
?>
<script>
$(function() {
var availableTags = [
<?php
while($event_row=mysql_fetch_array($events_result)) {
echo "\"".$event_row['event']."\",\n";
}
?>
];
$( "#tags" ).autocomplete({
source: availableTags
});
});
</script>
**EDIT: To clarify my question is will using the autocomplete slow down pages significantly? If so what methods can be used to improve this?
1 Answer