i'll prefer to populate a Jquery autocomplete search with database products... instead of utilizing an "names" with a listing of names designated into it, can one search from the database source ?

$(function() {
    var names = [ "sandy", "ruga", "malicka" ];

    var normalize = function( term ) {
        var ret = "";
        for ( var i = 0; i < term.length; i++ ) {
            ret += accentMap[ term.charAt(i) ] || term.charAt(i);
        }
        return ret;
    };

    $( "#developer" ).autocomplete({
        source: function( request, response ) {
            var matcher = new RegExp( $.ui.autocomplete.escapeRegex( request.term ), "i" );
            response( $.grep( names, function( value ) {
                value = value.label || value.value || value;
                return matcher.test( value ) || matcher.test( normalize( value ) );
            }) );
        }
    });
});

The overall idea is:

if(User starts typing in search box) {

    Fire keydown event in JavaScript {

        Send ajax request to your database,
            return a JSON object with relevant data

        Populate a list with those hits

        Assign said list to autocomplete
    }
}

Make use of AJAX.

AJAX can be used to transmit demands to some remote server after which get the data in the server.

In the server side, you may make something which will go ahead and take specific demands as well as in response send the end result. Next, it can save you the increase the risk for list and do your work now.

Take a look example from jQuery UI auto-complete: http://jqueryui.com/demos/autocomplete/#multiple-remote

The fundamental idea goes like:

...
source: function( request, response ) {
    $.getJSON( "yourserver/data.php", {...params...}, response );
},
...