Hi first of all thx for taking time reading this.
Second, when using the combo_firm_name.enableFilteringMode(true,“/phpmyadmin/research_invoice_combo.php”,true);
we get problems when we want to get results.
This is what should happen.
First example:
user types in “Solutions”
Result should be “Ilias Solutions” and other frim names containing Solutions
next example
user types in “tra”
Result should be “Eltrabel” and other frim names containing tra
What we tried so far.
It work perfect when whe filter from first letter. We only have to type in 2 letters and we get a nice result.
When we try to use the filter when the name contains the mask whe get strange results.
First example:
user types in “Solutions”
Result “no results”
next example
user types in “tra”
Result “no result” until we type in “trabe”
next example
user types in “zh”
Result “Zhendre”
We tried to find out why we get sometimes results with 2 letters, Sometimes we need 4 or More and sometimes we get no result.
Sadly we are stuck.
Any help would be nice.
ps there are about 15.1K different firms
Here is the php file.
'<complete>';
function p($s) {
if (!get_magic_quotes_gpc()) return mysql_real_escape_string($s);
return $s;
}
//Here we set connection and database and test if all is oke.
if (!isset($_REQUEST["pos"])) $_REQUEST["pos"]=0;
$mask = @$_REQUEST["mask"];
$pos = @$_REQUEST["pos"];
if (!is_numeric($pos)) $pos = 0;
$res = mysql_query("SELECT distinct name
FROM local_research_invoice WHERE LOWER(name) LIKE LOWER('".p($mask)."%') ORDER BY name LIMIT ".p($pos).", 40");
while ($row = mysql_fetch_array($res)) $xml .= '<option value="'.$row["name"].'">'.$row["name"].'</option>';
mysql_free_result($res);
$xml .= '</complete>';
print_r($xml);
?>