Advertisement
humpda

Print_Table

Mar 14th, 2022
1,036
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.39 KB | None | 0 0
  1. <?php
  2.  
  3. //this code can go underneath the connection details.
  4.  
  5. $query = mysqli_query($conn, "Select ID, Age, DoB from student_details") or die(mysql_error($conn));
  6. echo("<table border=\"1\">");
  7. while ($row = mysqli_fetch_array($query)) {
  8.     printf("<tr> <td>%s</td> <td>%s</td>  <td>%s</td>   </tr>", $row['ID'], $row['Age'], $row['DoB']);
  9. }
  10. echo("</table>");
  11.  
  12. mysqli_close($conn);
  13.  
  14. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement