Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2014
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.83 KB | None | 0 0
  1. <?php require("common.php");?>
  2. <?php
  3. if(!empty($_POST))
  4. {
  5. $sth = $db->prepare("SELECT * FROM customer WHERE First_name LIKE '%$First_name%' OR Surname LIKE '%$Surname%' OR DOB LIKE '$DOB' OR Street LIKE '%$Street%' OR Suburb LIKE '$Suburb' OR State LIKE '$State' OR Postcode LIKE '$Postcode' OR Phone LIKE '$Phone'");
  6. $sth->execute();
  7.  
  8. /* Fetch all of the remaining rows in the result set */
  9. print("Fetch all of the remaining rows in the result set:n");
  10. $result = $sth->fetchAll();
  11. print_r($result);
  12.  
  13.  
  14.  
  15. $First_name = $_POST['First_name'];
  16. $Surname = $_POST['Surname'];
  17. $DOB = $_POST['DOB'];
  18. $Street = $_POST['Street'];
  19. $Suburb = $_POST['Suburb'];
  20. $State = $_POST['State'];
  21. $Postcode = $_POST['Postcode'];
  22. $Phone = $_POST['Phone'];
  23. }
  24. ?>
  25. <fieldset><legend>Find a customer</legend>
  26. <form name="querycustomerform" method="post" action="qcustomer.php">
  27. <table class="five">
  28. <tr>
  29. <td colspan="4">
  30. <h3>Please fill out as many details as possible</h3>
  31. </td>
  32. </tr>
  33. <tr>
  34. <td>
  35. <input type="text" name="First_name" maxlength="30" size="30" placeholder="First name">
  36. </td>
  37. <td>
  38. <input type="text" name="Surname" maxlength="30" size="30" placeholder="Surname">
  39. </td>
  40. <td style="text-align: right">Date of Birth:</td>
  41. <td>
  42. <input type="date" name="DOB">
  43. </td>
  44. </tr>
  45. <tr>
  46. <td>
  47. <input type="text" name="Street" maxlength="40" size="30" placeholder="Street Address">
  48. </td>
  49. <td>
  50. <input type="text" name="Suburb" maxlength="15" size="30" placeholder="Suburb">
  51. </td>
  52. <td>
  53. <select name="State">
  54. <option value="">State</option>
  55. <option value="ACT">Australian Capital Territory</option>
  56. <option value="NSW">New South Wales</option>
  57. <option value="NT">Northern Territory</option>
  58. <option value="QLD">Queensland</option>
  59. <option value="SA">South Australia</option>
  60. <option value="TAS">Tasmania</option>
  61. <option value="VIC">Victoria</option>
  62. <option value="WA">Western Australia</option>
  63. </select>
  64. </td>
  65. <td>
  66. <input type="text" name="Postcode" maxlength="4" size="30" placeholder="Postcode">
  67. </td>
  68. </tr>
  69. <tr>
  70. <td>
  71. <input type="text" name="Phone" maxlength="15" size="30" placeholder="Phone Number">
  72. </td>
  73. <td>
  74. </td>
  75. <td>
  76. </td>
  77. <td>
  78. <input class="button" type="submit" value="Search">
  79. </td>
  80. </tr>
  81. </table>
  82. </form>
  83. </fieldset>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement