I've got an array with 6000 plus user names that I've pulled from MySQL like this:
$pop = mysql_query("SELECT * FROM import_student");
while ($r = mysql_fetch_assoc($pop)) {
$student_array[] = $r['studentfirstname']." ".$r['studentlastname'];
}
$big_array = json_encode($student_array);
I then pass this array to JS and initialize my auto complete function like this.
<script>
$(document).ready(function() {
var availableTags = <?php echo $big_array; ?>;
console.log(availableTags);
$( "#tags" ).autocomplete({
source: availableTags
});
});
</script>
This works great when I limit the SQL results to 0,10, but when I don't limit and I get the 6000 or so usernames into the array, the autocomplete doesn't work. I get this error in firebug:
value is null
return matcher.test( value.label || value.value || value );
Anyone know what I'm doing wrong here? Like I said, this works when I limit the results. Something about having a large array? IDK.