
spluskhan
Members-
Posts
11 -
Joined
-
Last visited
Everything posted by spluskhan
-
its not helping . i need database suggesion
- 4 replies
-
- auto search
- search
-
(and 2 more)
Tagged with:
-
any 1
- 4 replies
-
- auto search
- search
-
(and 2 more)
Tagged with:
-
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:
-
im new n php if u give me code thats wll b gr8
-
if u give me sme example
-
suppose i have 10 products in my database Example: iphone 2 - iphone 3g - laptop i3 - laptop i7 - nokia n96 etc when i enter iphone in my search i see all records stored in database thats my prob! what i want ? suppose if i enter laptop i7 or laptop then i get result for laptop i7 or laptop here is my code.. <?php // Connects to your Database mysql_connect("host.com", "userr", "pass") or die(mysql_error()); mysql_select_db("products") or die(mysql_error()); $data = mysql_query("SELECT * FROM Products") or die(mysql_error()); Print "<table border cellpadding=3>"; while($info = mysql_fetch_array( $data )) { Print "<tr>"; Print "<th>Name:</th> <td>".$info['name'] . "</td> "; Print "<th>new:</th> <td>".$info['new_price'] . "</td> "; Print "<th>old:</th> <td>".$info['old_proce'] . "</td> "; Print "<th>faulty:</th> <td>".$info['Faulty_price'] . " </td></tr>"; } Print "</table>"; ?> if any one have better code then please give me tankxx
-
Give me example
-
<?php $con=mysqli_connect("exapmle.com","user","pass","d atabase"); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $sql="INSERT INTO Products (name, available_conditions, v.good, good, poor, faulty) VALUES ('$_POST[name]','$_POST[available_conditions]','$_POST[v.good]','$_POST[good]','$_POST[poor]','$_POST[faulty]')"; if (!mysqli_query($con,$sql)) { die('Error: ' . mysqli_error()); } echo "1 record added"; mysqli_close($con); ?>
-
Parse error: syntax error, unexpected '.', expecting ']' in /home/pk.co.pk/uk.pko/insert.php on line 125 ++++++++++ inser.php +++++++++ <?php $con=mysqli_connect("exapmle.com","user","pass","d atabase"); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $sql="INSERT INTO Products (name, available_conditions, v.good, good, poor, faulty) VALUES ('$_POST[name]','$_POST[available_conditions]','$_POST[v.good]','$_POST[good]','$_POST[poor]','$_POST[faulty]')"; if (!mysqli_query($con,$sql)) { die('Error: ' . mysqli_error()); } echo "1 record added"; mysqli_close($con); ?> ++++++++++++++++++++++++++++++++++++++ And Here is the form: +++++++++++++++++++++++++++++++++++++++ <div id="wb_Form1" style="position:absolute;width:361px;height:270px;"> <form name="Add_New_Items" method="post" action="insert.php" enctype="text/plain" id="Form1"> <div id="wb_Text1" style="position:absolute;left:10px;top:15px;width:121px;height:16px;z-index:30;text-align:left;"> <span style="color:#000000;font-family:Arial;font-size:13px;">name:</span></div> <input type="text" id="Editbox1" style="position:absolute;left:141px;top:15px;width:198px;height:23px;line-height:23px;z-index:31;" name="Editbox1" value=""> <div id="wb_Text2" style="position:absolute;left:10px;top:45px;width:121px;height:32px;z-index:32;text-align:left;"> <span style="color:#000000;font-family:Arial;font-size:13px;">available_conditions:</span></div> <input type="text" id="Editbox2" style="position:absolute;left:141px;top:45px;width:198px;height:23px;line-height:23px;z-index:33;" name="Editbox2" value=""> <div id="wb_Text3" style="position:absolute;left:10px;top:75px;width:121px;height:16px;z-index:34;text-align:left;"> <span style="color:#000000;font-family:Arial;font-size:13px;">v.good:</span></div> <input type="text" id="Editbox3" style="position:absolute;left:141px;top:75px;width:198px;height:23px;line-height:23px;z-index:35;" name="Editbox3" value=""> <div id="wb_Text4" style="position:absolute;left:10px;top:105px;width:121px;height:16px;z-index:36;text-align:left;"> <span style="color:#000000;font-family:Arial;font-size:13px;">good:</span></div> <input type="text" id="Editbox4" style="position:absolute;left:141px;top:105px;width:198px;height:23px;line-height:23px;z-index:37;" name="Editbox4" value=""> <div id="wb_Text5" style="position:absolute;left:10px;top:135px;width:121px;height:16px;z-index:38;text-align:left;"> <span style="color:#000000;font-family:Arial;font-size:13px;">poor:</span></div> <input type="text" id="Editbox5" style="position:absolute;left:141px;top:135px;width:198px;height:23px;line-height:23px;z-index:39;" name="Editbox5" value=""> <div id="wb_Text7" style="position:absolute;left:10px;top:165px;width:121px;height:16px;z-index:40;text-align:left;"> <span style="color:#000000;font-family:Arial;font-size:13px;">faulty:</span></div> <input type="text" id="Editbox6" style="position:absolute;left:141px;top:165px;width:198px;height:23px;line-height:23px;z-index:41;" name="Editbox6" value=""> <input type="submit" id="Button1" name="" value="Submit" style="position:absolute;left:141px;top:195px;width:96px;height:25px;z-index:42;"> <input type="reset" id="Button2" name="" value="Reset" style="position:absolute;left:141px;top:225px;width:96px;height:25px;z-index:43;"> </form> </div>
-
any body plz help
-
Ha Gyz, I Need Database for my Products: id image of product Condition Product Info Price And 1 Other thing i want search engine for my site to display data from database. Plz Plz Help Me . I Make the following but its not working: id int(10) No auto_increment Image longblob BINARY No name varchar(32) decription varchar(255)