Search the Community
Showing results for tags 'auto search'.
-
hello all of you. i have database name Products id pr_name good poor faulty i need auto complete search that they suggest (pr_name) from my phpmyadmin database. this is my search code: <div id="wb_Form2" style="position:absolute;width:483px;height:112px;"> <form name="search" method="get" action="db1.php" id="Form2" onsubmit="return Validatesearch(this)"> <input type="text" id="Editbox8" style="position:absolute;left:11px;top:17px;width:456px;height:38px;line-height:38px;z-index:2;" name="query" value="" autocomplete="off" input type="text" name="query"> <input type="submit" id="Button3" name="" value="Add" style="position:absolute;left:192px;top:71px;width:96px;height:37px;z-index:3;"> </form> </div> and this is my search code: <html> <body> <head> <font size="3"><strong> <?php // Connects to your Database mysql_connect("host", "user", "pass") or die(mysql_error()); mysql_select_db("table") or die(mysql_error()); $q = mysql_real_escape_string($_GET['query']); $data = mysql_query("SELECT * FROM Products where name LIKE '%$q%'") or die(mysql_error()); while($info = mysql_fetch_array( $data )) { echo "Product Name: $info[name]<br>"; echo "Good Price: $info[good]<br>"; echo "Poor Price: $info[poor]<br>"; echo "Faculty Price: $info[faulty]<br><br>"; } ?>
- 4 replies
-
- auto search
- search
-
(and 2 more)
Tagged with: