Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Autocomplete form field using PHP and MYSQL

Posted on 2007-11-19
4
Medium Priority
?
7,364 Views
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?

Thanks,
//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'>
   <tr>
     <td>Nome do medicamento:</td>
     <td><input type='text' name='name' size=60 maxlength=128></td></tr>
   <tr>
     <td>Code Number :</td>
     <td valign='top'><input type='text' name='code_number'
                     size=10 maxlength=7></td></tr>
   <tr>
   <tr>
     <td>Code2 :</td>
     <td valign='top'><input type='text' name='code2'
                     size=5	maxlength=2></td></tr>
   <tr>
     <td>Quantity:</td>
     <td valign='top'><input type='text' name='quantity'
                     size=5 maxlength=6></td></tr>
   <tr>
     <td> Price :</td>
     <td><input type='text' name='price' size=5 maxlength=6></td></tr>
   <tr>
     <td colspan=2 align='center'>
     <input type='submit' value='OK'></td>
    </tr>
 </table></form>

Open in new window

0
Comment
Question by:alester
4 Comments
 
LVL 3

Accepted Solution

by:
seandolan earned 750 total points
ID: 20316844
0
 
LVL 21

Expert Comment

by:nizsmo
ID: 20319091
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.
0
 

Author Comment

by:alester
ID: 20340670
Thanks seandolan and nizsmo, i´ll see if seandolan solution works.
0
 

Expert Comment

by:lepricon
ID: 23361197
A good idea is to look at this PHP component, I use it in a number of projects and the performance is satisfactory

http://woork.blogspot.com/2008/03/php-components-autosuggest.html
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

916 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