Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2017
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. <!doctype html>
  2.  
  3. <html lang="en">
  4. <head>
  5. <title>Inisope Online Directory</title>
  6. </head>
  7. <body>
  8. <?php
  9. $servername = "localhost";
  10. $username = "jmelander";
  11. $password = "jmelander";
  12. $dbname = "hr_employees";
  13.  
  14. $conn = new mysqli($servername, $username, $password, $hr_employees);
  15.  
  16. $sql = "SELECT FIRST_NAME, LAST_NAME, EMAIL FROM employees WHERE FIRST_NAME, LAST_NAME, EMAIL LIKE '%" . $_POST['info']. "%'";
  17. $result = $conn->query($sql);
  18.  
  19. ?>
  20. <table>
  21. <tr>
  22. <td>First Name</td>
  23. <td>Last Name</td>
  24. <td>Email</td>
  25. </tr>
  26. <?php
  27. if ($result->num_rows > 0){
  28. while ($row = $result->fetch_assoc()){
  29. printf ("<tr><td>%s</td><td>%s</td><td>%s</td></tr>", $row["LAST_NAME"], $row["FIRST_NAME"], $row["EMAIL"]);
  30. }
  31. }
  32. else{
  33. echo "0 results <br>";
  34. }
  35. ?>
  36. </table>
  37.  
  38. </body>
  39. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement