Advertisement
Guest User

Untitled

a guest
May 26th, 2019
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.57 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <link rel="stylesheet" href="style.css">
  6. <title>MENU</title>
  7. </head>
  8. <body>
  9. <?php
  10. $conn = mysqli_connect('localhost', 'root', '', 'cinema');
  11.  
  12. if (!$conn) {
  13. die ("Не удалось выполнить соединение" . mysqli_connect_error());
  14. }
  15.  
  16. mysqli_set_charset($conn, 'utf8');
  17.  
  18. $sql = "SELECT * FROM movie";
  19. $result = mysqli_query($conn, $sql);
  20.  
  21. $sql_movie = "SELECT DISTINCT name FROM movie";
  22. $result_movie = mysqli_query($conn, $sql_movie);
  23. ?>
  24. <!-- MENU BAR table border="0" width="100%" cellpadding="5" style="text-align: center;"-->
  25. <div class="">
  26. <div class="">
  27. <table class="rwd-table">
  28. <tr style="color:#FFD74F;font-size: 20">
  29. <th>Film</th>
  30. <th>Time/Ticket Cost</th>
  31. <th>Cinema Hall</th>
  32. </tr>
  33. <tr>
  34. <!-- -->
  35. <?php
  36. $a = '<td>';
  37. $b = '</td>';
  38. $c = '<tr>';
  39. $d = '</tr>';
  40. while ($row = mysqli_fetch_array($result_movie)) {
  41. echo $c;
  42. echo $a; echo $row['name']; echo $b;
  43. echo $a;
  44.  
  45. foreach ($result_movie as $value){
  46.  
  47. $sql_price_session = "SELECT session,price FROM movie WHERE $value = name";
  48. $result_p_s = mysqli_query($conn, $sql_price_session);
  49.  
  50. while ($row_p_s = mysqli_fetch_array($result_p_s)) {
  51. echo "<select>";
  52. echo "<option>";
  53. echo $row_p_s['session'];
  54. echo " / ";
  55. echo $row_p_s['price'];
  56. echo "</option>";
  57. echo "</select>";
  58. }
  59. }
  60. echo $b;
  61. echo $a; echo $row['number_hall']; echo $b;
  62. echo $d;
  63. }
  64. ?>
  65. </tr>
  66. </table>
  67. </div>
  68. </div>
  69. </body>
  70. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement