Autocomplete form field using PHP and MYSQL

Posted on 2007-11-19
Last Modified: 2013-12-13
Hello Guy,

       I´m trying to use a text form field with autocomplete function (the data comes from mysql database). I tried to use the dmsautocomplete script but I cant get this script to work.

Could you help me to get this work?

//The form is this

//I´m using mysqli to connect to database and PHP 5

<form method='post' action='new_registry.php'>

 <table bgcolor='#cccccc'>


     <td>Nome do medicamento:</td>

     <td><input type='text' name='name' size=60 maxlength=128></td></tr>


     <td>Code Number :</td>

     <td valign='top'><input type='text' name='code_number'

                     size=10 maxlength=7></td></tr>



     <td>Code2 :</td>

     <td valign='top'><input type='text' name='code2'

                     size=5	maxlength=2></td></tr>



     <td valign='top'><input type='text' name='quantity'

                     size=5 maxlength=6></td></tr>


     <td> Price :</td>

     <td><input type='text' name='price' size=5 maxlength=6></td></tr>


     <td colspan=2 align='center'>

     <input type='submit' value='OK'></td>



Open in new window

Question by:alester

Accepted Solution

seandolan earned 250 total points
Comment Utility
LVL 21

Expert Comment

Comment Utility
bearing in mind that if the speed is a factor (response), then autocomplete is probably not a good idea as retrieving from the server back and forth can be laggy and resource consuming.

Author Comment

Comment Utility
Thanks seandolan and nizsmo, i´ll see if seandolan solution works.

Expert Comment

Comment Utility
A good idea is to look at this PHP component, I use it in a number of projects and the performance is satisfactory

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now