3
Contributors
7
Replies
30
Views
3 Years
Discussion Span
Last Post by lloydsbackyard
0

pls help me improve this code.. on change, it search the database and the query will be drop down..

<input size="35"  name="supplier" type="text" class="ed"
 value="
 <?php
echo "<select>";
$query = "SELECT * from supplier ORDER BY company ASC";
$result = mysql_query($query);
while ($record = mysql_fetch_array($result)){
 echo "<option>{$record['company']}<option>";
}
echo "</select>"; ?>
0

You should give a value to option : <option value=\"$record['company']\">$record['company']</option> notice the closing option tag - in your code / is missing.
Plus what is the problem you are facing, you should post that after making the above changes.

0

i just want to make a search box..when i type anything on the input box, then a dropdown displays data from the database... like a google search box..when you type there is a dropdown related to the search string..

ill try to modify my codes..abovee..thnx

Edited by lloydsbackyard

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.