<%
'we expect a parameter named "query" from the ajax call. make sure to protect against SQLinjection
'in this query, the searchstring will be searched for in the entire country-name ('%query%'). 
'if you prefer to only search for country names BEGINNING with the querystring, use 'query%'

set rs=db.rs
rs.open("select sText from country where sText like '%" & aspl.sqli(aspl.getRequest("query")) & "%'")

if not rs.eof then
	aspl.dumpJson(aspl.json.toJSON("suggestions",rs.getRows,false))
else
	aspl.dumpJson(aspl.json.toJSON("suggestions","",false))
end if
%>