As you will notice, I am a data scientist and not a programmer / developper.
In SQL, I have a database with ten-thousands of names. I managed to implement the selectize.js tool in my twitter bootstrap website, but it loads way to slow. On the help page from Selectize.js, https://github.com/brianreavis/selectize.js/blob/master/docs/usage.md, I read that it is possible to load options on the fly when the user enters something.
But from the examples I can not find out how to do this from an SQL table. Can somebody write in pseudo code what I would have to do?
In short, when the user types some names, I want the script to go find in the SQL table these names and make select html tags, rather than downloading everyname already at the beginning.
This is the code I have at the moment:
<div class="control-group">
<select id="select-yourself" class="demo-default" placeholder="Type your name...">
<option value="">Type your name ...</option>
<?php
for($row = 0; $row < sizeof($race_table); $row++){
echo("<option value=".$row.">".
$race_table[$row]['Name']."</option>");
}
?>
</select>
</div>
<script>
$('#select-yourself').selectize({
create: false,
maxOptions: 100,
//sortField: {
//field: 'text',
//direction: 'asc'
//},
dropdownParent: 'body'
});