php - Improving Ajax auto-complete to return better result -
i using ajax & php fetch elements matches keys(letters) entered user elements resembling database. for e.g database contain manufacturer names as: hydfloo, rexflex, easton, vickters, ever gush, thomas hydraulics, avt pumps and example user has entered letter "h" input box. receive hydfloo return , not thomas hydraulics along it. if "p" typed wd expect see "avt pumps". changes need make php in order able have values returned matches either first or second word of manufacturer name. php code <?php require('../config/connection.php'); if(!$dbc) { echo 'could not connect database.'; } else { if(isset($_post['querystring'])) { $querystring = mysqli_real_escape_string($dbc, $_post['querystring']); if(strlen($querystring) >0) { $query = mysqli_query($dbc, "select distinct name prdct_subcat name '$querystring%' limit 10"); echo '<ul>'; w...