daily pastebin goal
72%
SHARE
TWEET

Untitled

a guest Feb 13th, 2018 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $x = 1;
  2.     $query = "SELECT * FROM `persons` WHERE CODE_NO = '$x'";
  3.     $result = mysqli_query($con, $query);
  4.  
  5.     }
  6.  
  7. $table = "<table>"; // table tag in HTML
  8.  
  9.  
  10. while($row = mysqli_fetch_array($result))
  11. {
  12. //Creates a loop to loop through results
  13. $table .= "<tr>";
  14. $table .= "<th>CODE_NO:</th>";
  15. $table .= "<td>" . $row['CODE_NO'] . "</td>";
  16. $table .= "</tr>";
  17. $table .= "<tr>";
  18. $table .= "<th>FIRST_NAME:</th>";
  19. $table .= "<td>" . $row['FIRST_NAME'] . "</td>";
  20. $table .= "</tr>";
  21. $table .= "<tr>";
  22. $table .= "<th>SURNAME:</th>";
  23. $table .= "<td>" . $row['SURNAME'] . "</td>";
  24. $table .= "</tr>";
  25. $table .= "<tr>";
  26. $table .= "<th>Date of birth:</th>";
  27. $table .= "<td>" . $row['DOB'] . "</td>";
  28. $table .= "</tr>";
  29. $table .= "<tr>";
  30. $table .= "<th>Date of death:</th>";
  31. $table .= "<td> " . $row['DOD'] . "</td>";
  32. $table .= "</tr>";
  33. }
  34. $table .= "</table>"; //Close the table in HTML
  35.  
  36. echo $table;
  37.  
  38. ?>
RAW Paste Data
Top