hip1/po/albums.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'); #Display page name $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=$band_id>$row1[name]</a> - Albums</h1>"; echo "<h3>Albums: </h3>"; $query2 = "select * from albums where band_id = $band_id order by release_date DESC, album_id"; $result2 = mysqli_query($db, $query2) or die(mysqli_error($db)); while($row2 = mysqli_fetch_array($result2)){ $date = convertdate($row2['release_date']); echo "<h4><a href=albuminfo.php?album_id=$row2[album_id]>$row2[name]</a> ($date) $row2[type]</h4>"; } ?> </body> </html>

Resultaat

Made by Thijs Aarnoudse