I have changed it to an input field with this code
this is the input field:
<input name="tag" type="text" id="tag" size="60"/>
this is the script
<script>
$(document).ready(function(){
$("#tag").autocomplete("autocomplete.php", {
selectFirst: true
});
});
</script>
the autocomplete;php :
$q=$_GET['q'];
$my_data=mysqli_real_escape_string($conn,$q);
//$mysqli=mysqli_connect('localhost','root','','autofield') or die("Database Error");
$sql="SELECT * FROM Patienten WHERE PATNR LIKE '$my_data%'";
$result = mysqli_query($conn,$sql) or die(mysqli_error());
if($result)
{
while($row=mysqli_fetch_array($result))
{
$naam=STR_PAD($row['PATNAAM'],20,".",STR_PAD_RIGHT);
$voornaam=STR_PAD($row['PATVNAAM'],20,".",STR_PAD_RIGHT);
echo $row['PATNR']."....".$naam.$voornaam."n";
$_SESSION["NAAM"]=$naam;
$_SESSION["PATNR"]=$row['PATNR'];
}
}
?>
this fills my inputfield in about 15 seconds; but it is still too slow
Guido