Guest User

Untitled

a guest
Dec 19th, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. <?php
  2. include_once("public_html/dreamconnect.php");
  3.  
  4. $title = "Welcome to the website";
  5. html_begin($title,$title);
  6. ?>
  7. <p>Simple Staff Count </p>
  8.  
  9. <?php
  10. $servername = "localhost";
  11. $username = "****";
  12. $password = "****";
  13. $dbname = "mydb";
  14. $conn_id = mysqli_connect($servername, $username, $password);
  15. dream_connect()
  16. or exit();
  17. $query = "select * FROM staff";
  18. $result_id = mysqli_query($conn_id, $query);
  19.  
  20. print("<table>n");
  21. while($row = mysqli_fetch_row($result_id))
  22. {
  23.  
  24. print("<tr>n");
  25. for($i = 0; $i < mysqli_num_fields($result_id); $i++)
  26. {
  27. printf("<td>%s</td>n",htmlspecialchars($row[$i]));
  28. }
  29. print("</tr>n");
  30. }
  31. mysqli_free_result($result_id);
  32. print("</table>n");
  33. html_end();
  34. ?>
Add Comment
Please, Sign In to add comment