" . substr($x, 0, strlen($var)) . "" . substr($x, strlen($var), strlen($x) - strlen($var)); else return $x; } function getTaxonList($query) { $max_rows = 50; $p = $query->getParam(0); $pat = ucfirst($p->scalarval()); $p = $query->getParam(1); $table = str_replace('field_', 'suggest', $p->scalarval()); $sql = "select TOP ".$max_rows." Name, unitCount from $table where Name LIKE '$pat%' ORDER BY Name ASC "; // connect to ODBC data source $conn = odbc_connect('syn_vh', 'WebUser', 'WebUser2014'); if (!$conn) { exit("Connection Failed: " . odbc_errormsg($conn)); } // execute sql query $result = odbc_exec($conn, $sql); if (!$result) { exit("Error in SQL"); } $s = ""; $i = 0; while ( ($row = odbc_fetch_array($result))) { $s .= "