Okay...so I've actually decided on using the Twitter typeahead.js, as I managed to get it working. I used the following code, please someone point out if it's not the best way to do it.
<input type="text" id="tagFilter" data-provide="typeahead" value="test,arlington">
$('#tagFilter').tagsinput({
typeahead: {
source: $.get('tags.php')
}
});
My tags.php file is just a list, I think it will take a lot more work to get this to function with an associative array with keys in the JSON file. I decided there was no benefit to this in my case, as I'm only concerned with the tag names for query purposes.
So my tags.php is just echoing the result of:
//the mySQLi query is above...
while ($row = mysqli_fetch_assoc($result)) {
$tags[] = $row['tag_name'];
}
echo json_encode($tags);
Hope someone can benefit.