hip1/po/concertinfo.php

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> </head> <body> <div><a href='index.php'>Return to search</a></div> <?php include('../db.php'); include('functions.php'); $concert_id = $_GET['concert_id']; $query1 = "select * from concerts where concert_id = $concert_id"; $result1 = mysqli_query($db, $query1) or die(mysqli_error($db)); while($row1 = mysqli_fetch_array($result1)){ echo "<h1>$row1[location]</h1> <div>Date: ".convertdate($row1['concert_date'])."</div> <div>Total tickets: $row1[tickets_total]</div> <div>Tickets sold: "; if($row1['tickets_sold']){ echo $row1['tickets_sold']; } else{ echo "Sale is still ongoing"; } echo "</div> <h3>Attendees:</h3>"; $query2 = "select * from bands where band_id in (select band_id from concert_bands where concert_id = $concert_id)"; $result2 = mysqli_query($db, $query2) or die(mysqli_error($db)); while($row2 = mysqli_fetch_array($result2)){ echo "<div><a href=bandinfo.php?band_id=$row2[band_id]>$row2[name]</a></div>"; } } ?> </body> </html>

Resultaat

Made by Thijs Aarnoudse