Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html lang="en">
- <head>
- <title>Inisope Online Directory</title>
- </head>
- <body>
- <?php
- $servername = "localhost";
- $username = "jmelander";
- $password = "jmelander";
- $dbname = "hr_employees";
- $conn = new mysqli($servername, $username, $password, $hr_employees);
- $sql = "SELECT FIRST_NAME, LAST_NAME, EMAIL FROM employees WHERE FIRST_NAME, LAST_NAME, EMAIL LIKE '%" . $_POST['info']. "%'";
- $result = $conn->query($sql);
- ?>
- <table>
- <tr>
- <td>First Name</td>
- <td>Last Name</td>
- <td>Email</td>
- </tr>
- <?php
- if ($result->num_rows > 0){
- while ($row = $result->fetch_assoc()){
- printf ("<tr><td>%s</td><td>%s</td><td>%s</td></tr>", $row["LAST_NAME"], $row["FIRST_NAME"], $row["EMAIL"]);
- }
- }
- else{
- echo "0 results <br>";
- }
- ?>
- </table>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement