hip1/po/memberinfo.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');
$member_id = $_GET['member_id'];
$query1 = "select * from members where member_id = $member_id";
$result1 = mysqli_query($db, $query1) or die(mysqli_error($db));
$row1 = mysqli_fetch_array($result1);
$fullname = nameDetermine($row1);
echo "<h1>$fullname</h1>
<div>Born: ";
if($row1['birth_date']){
echo convertdate($row1['birth_date']);
}
else{
echo "unknown";
}
echo "</div>";
if($row1['death_date']){
echo "Died: ".convertdate($row1['death_date']);
}
echo "<h3>Bands</h3>";
$query2 = "select * from band_members bm, bands b where member_id = $member_id and bm.band_id = b.band_id";
$result2 = mysqli_query($db, $query2) or die(mysqli_error($db));
while($row2 = mysqli_fetch_array($result2)){
echo "<h4><a href=bandinfo.php?band_id=$row2[band_id]>$row2[name]<a>:</h4>
<div>Joined: $row2[year_joined]</div>";
if($row2['year_left']){
echo "<div>Left: $row2[year_left]</div>";
}
echo "<div>Instruments: ";
$textdisplay = "";
$query3 = "select * from instruments where instrument_id in (select instrument_id from instrument_bm where bandm_id = $row2[bandm_id]) order by instrument_id";
$result3 = mysqli_query($db, $query3) or die(mysqli_error($db));
while($row3 = mysqli_fetch_array($result3)){
$textdisplay = $textdisplay.$row3['instrument_name'].", ";
}
$textdisplay = substr_replace($textdisplay, "", strlen($textdisplay)-2, 2);
echo "$textdisplay</div>";
}
?>
</body>
</html>
Resultaat
Made by Thijs Aarnoudse