Barebones PHP and JS AJAX functions to query a database and return data in search engine format