Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Autocomplete form field using PHP and MYSQL

Posted on 2007-11-19
4
Medium Priority
?
7,362 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
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.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.

705 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