hip1/po/concerts.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'); $band_id = $_GET['band_id']; $query1 = "select * from bands where band_id = $band_id"; $result1 = mysqli_query($db, $query1) or die(mysqli_error($db)); $row1 = mysqli_fetch_array($result1); echo "<h1><a href=bandinfo.php?band_id=$row1[band_id]>$row1[name]</a> - Concerts</h1>"; $query2 = "select * from concerts where concert_id in (select concert_id from concert_bands where band_id = $band_id)"; $result2 = mysqli_query($db, $query2) or die(mysqli_error($db)); while($row2 = mysqli_fetch_array($result2)){ echo "<h3><a href=concertinfo.php?concert_id=$row2[concert_id]>$row2[location]</a></h3> <div>Date: ".convertdate($row2['concert_date'])."</div> <div>Total tickets: $row2[tickets_total]</div> <div>Tickets sold: "; if($row2['tickets_sold']){ echo $row2['tickets_sold']; } else{ echo "Sale is still ongoing"; } echo "</div>"; } ?> </body> </html>

Resultaat

Made by Thijs Aarnoudse