Advertisement
zhvegaz

Untitled

May 22nd, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. <?php
  2.  
  3. $sql = "SELECT * FROM `diploms`";
  4. $result = mysqli_query($conn, $sql);
  5.  
  6. while ($row = mysqli_fetch_assoc($result))
  7. {
  8. $topic = $row['topic'];
  9. $mark = $row['mark'];
  10. $std_id = $row['id_std'];
  11. $id_teach = $row['id_teacher'];
  12.  
  13. $sql2 = "SELECT * FROM teachers WHERE id_teacher = '$id_teach'";
  14. $result2 = mysqli_query($conn, $sql2);
  15. while ($rowp = mysqli_fetch_assoc($result2))
  16. {
  17. $teach=$rowp['fullname'];
  18. }
  19.  
  20. $sql3 = "SELECT * FROM student WHERE id_std = '$std_id'";
  21. $result3 = mysqli_query($conn, $sql3);
  22. while ($rowp = mysqli_fetch_assoc($result3))
  23. {
  24. $std_surname=$rowp['surname'];
  25. $std_name=$rowp['name'];
  26. $std_otch=$rowp['otchestvo'];
  27. $std = $std_surname.' '.$std_name.' '.$std_otch;
  28. }
  29.  
  30. echo '<tr>
  31. <td>'.$topic.'</td>
  32. <td>'.$mark.'</td>
  33. <td>'.$std.'</td>
  34. <td>'.$teach.'</td>
  35. </tr>';
  36. }
  37.  
  38. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement