Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $dbuser="a8142231_items";
- $dbpass="boom123";
- $dbname = "a8142231_items";
- $chandle = mysql_connect("mysql15.000webhost.com", $dbuser, $dbpass)
- or die("Connection Failure to Database");
- mysql_select_db($dbname, $chandle) or die ($dbname . " Database not found." . $dbuser);
- ?>
- <fieldset>
- <form method=get>
- <input type=hidden name=action value=items>
- <input style="font-decoration:italics;" name=item value="<?php echo $_GET['item']; ?>">
- <input type=submit value=Search>
- </form>
- <table width=100%>
- <?php
- if(isset($_GET['item'])) {
- $mysql = mysql_query("SELECT * FROM items WHERE name LIKE '%".$_GET['item']."%'") or die(mysql_error());
- while($row = mysql_fetch_assoc($mysql)){
- echo '<tr><td>'.$row['id'].'</td><td>'.$row['name'].'</td></tr>';
- }
- }
- ?>
- </fieldset>
Add Comment
Please, Sign In to add comment