Guest User

Untitled

a guest
May 4th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. <?php
  2. $dbuser="a8142231_items";
  3. $dbpass="boom123";
  4. $dbname = "a8142231_items";
  5. $chandle = mysql_connect("mysql15.000webhost.com", $dbuser, $dbpass)
  6. or die("Connection Failure to Database");
  7. mysql_select_db($dbname, $chandle) or die ($dbname . " Database not found." . $dbuser);
  8. ?>
  9.  
  10. <fieldset>
  11. <form method=get>
  12. <input type=hidden name=action value=items>
  13. <input style="font-decoration:italics;" name=item value="<?php echo $_GET['item']; ?>">
  14. <input type=submit value=Search>
  15. </form>
  16. <table width=100%>
  17. <?php
  18. if(isset($_GET['item'])) {
  19. $mysql = mysql_query("SELECT * FROM items WHERE name LIKE '%".$_GET['item']."%'") or die(mysql_error());
  20. while($row = mysql_fetch_assoc($mysql)){
  21. echo '<tr><td>'.$row['id'].'</td><td>'.$row['name'].'</td></tr>';
  22. }
  23. }
  24. ?>
  25. </fieldset>
Add Comment
Please, Sign In to add comment