Jump to content

guidonts

Members
  • Posts

    6
  • Joined

  • Last visited

Posts posted by guidonts

  1. 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
  2. I'm not using javascript, because I don't know how to do it.

     

    this is the code I use

     

    $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'];
    }
    }
    $my_data = the input in the field
  3. Hello everyone

     

    I'm trying to fill in a combobox with a large amount of data (from a table containing about 100 000 names of patients).

     

    I can fill the box but it takes about 20 seconds before I can see the first items.

     

    Is there a way to do it very fast?

     

    I was using Micrsoft Access and there it is no problem to see all the names at once.

     

    Thank you very much.

     

    Guido

×
×
  • Create New...