Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php require("common.php");?>
- <?php
- if(!empty($_POST))
- {
- $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'");
- $sth->execute();
- /* Fetch all of the remaining rows in the result set */
- print("Fetch all of the remaining rows in the result set:n");
- $result = $sth->fetchAll();
- print_r($result);
- $First_name = $_POST['First_name'];
- $Surname = $_POST['Surname'];
- $DOB = $_POST['DOB'];
- $Street = $_POST['Street'];
- $Suburb = $_POST['Suburb'];
- $State = $_POST['State'];
- $Postcode = $_POST['Postcode'];
- $Phone = $_POST['Phone'];
- }
- ?>
- <fieldset><legend>Find a customer</legend>
- <form name="querycustomerform" method="post" action="qcustomer.php">
- <table class="five">
- <tr>
- <td colspan="4">
- <h3>Please fill out as many details as possible</h3>
- </td>
- </tr>
- <tr>
- <td>
- <input type="text" name="First_name" maxlength="30" size="30" placeholder="First name">
- </td>
- <td>
- <input type="text" name="Surname" maxlength="30" size="30" placeholder="Surname">
- </td>
- <td style="text-align: right">Date of Birth:</td>
- <td>
- <input type="date" name="DOB">
- </td>
- </tr>
- <tr>
- <td>
- <input type="text" name="Street" maxlength="40" size="30" placeholder="Street Address">
- </td>
- <td>
- <input type="text" name="Suburb" maxlength="15" size="30" placeholder="Suburb">
- </td>
- <td>
- <select name="State">
- <option value="">State</option>
- <option value="ACT">Australian Capital Territory</option>
- <option value="NSW">New South Wales</option>
- <option value="NT">Northern Territory</option>
- <option value="QLD">Queensland</option>
- <option value="SA">South Australia</option>
- <option value="TAS">Tasmania</option>
- <option value="VIC">Victoria</option>
- <option value="WA">Western Australia</option>
- </select>
- </td>
- <td>
- <input type="text" name="Postcode" maxlength="4" size="30" placeholder="Postcode">
- </td>
- </tr>
- <tr>
- <td>
- <input type="text" name="Phone" maxlength="15" size="30" placeholder="Phone Number">
- </td>
- <td>
- </td>
- <td>
- </td>
- <td>
- <input class="button" type="submit" value="Search">
- </td>
- </tr>
- </table>
- </form>
- </fieldset>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement