Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <link rel="stylesheet" href="style.css">
- <title>MENU</title>
- </head>
- <body>
- <?php
- $conn = mysqli_connect('localhost', 'root', '', 'cinema');
- if (!$conn) {
- die ("Не удалось выполнить соединение" . mysqli_connect_error());
- }
- mysqli_set_charset($conn, 'utf8');
- $sql = "SELECT * FROM movie";
- $result = mysqli_query($conn, $sql);
- $sql_movie = "SELECT DISTINCT name FROM movie";
- $result_movie = mysqli_query($conn, $sql_movie);
- ?>
- <!-- MENU BAR table border="0" width="100%" cellpadding="5" style="text-align: center;"-->
- <div class="">
- <div class="">
- <table class="rwd-table">
- <tr style="color:#FFD74F;font-size: 20">
- <th>Film</th>
- <th>Time/Ticket Cost</th>
- <th>Cinema Hall</th>
- </tr>
- <tr>
- <!-- -->
- <?php
- $a = '<td>';
- $b = '</td>';
- $c = '<tr>';
- $d = '</tr>';
- while ($row = mysqli_fetch_array($result_movie)) {
- echo $c;
- echo $a; echo $row['name']; echo $b;
- echo $a;
- foreach ($result_movie as $value){
- $sql_price_session = "SELECT session,price FROM movie WHERE $value = name";
- $result_p_s = mysqli_query($conn, $sql_price_session);
- while ($row_p_s = mysqli_fetch_array($result_p_s)) {
- echo "<select>";
- echo "<option>";
- echo $row_p_s['session'];
- echo " / ";
- echo $row_p_s['price'];
- echo "</option>";
- echo "</select>";
- }
- }
- echo $b;
- echo $a; echo $row['number_hall']; echo $b;
- echo $d;
- }
- ?>
- </tr>
- </table>
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement