Ok, the simplest thing would be for you to repeat that code block 3 times. Each time, with a different Artist ID passed to the Query:
<?php
include "Connection.php";
$sql = "SELECT artist.artistName, artistcd.artistID, artistcd.cdID, artistcd.cdTitle, artistcd.cdGenre, artistcd.cdPrice
FROM artist, artistcd
WHERE artist.artistID = "$ArtistID1";
$query = mysqli_query($connect, $sql) or die("Error: ".mysqli_error($connect));;
$name = mysqli_fetch_assoc($query);
echo "<p>" . $name["artistID"] . $name["artistName"] . "</p>";
?>
<table width="70%" cellpadding="5" cellspace="5">
<tr>
<th>Genre</th>
<th>CD Identification</th>
<th>Title</th>
<th>Price</th>
</tr>
<?php
while ($row = mysqli_fetch_assoc($query)) {
echo "<tr>";
echo "<td>" . $row['cdGenre']. "</td>";
echo "<td>" . $row['cdID']. "</td>";
echo "<td>" . $row['cdTitle']. "</td>";
echo "<td>" . $row['cdPrice']. "</td>";
echo "</tr>";
}
?>
<table width="70%" cellpadding="5" cellspace="5">
</table>
<?php
$sql = "SELECT artist.artistName, artistcd.artistID, artistcd.cdID, artistcd.cdTitle, artistcd.cdGenre, artistcd.cdPrice
FROM artist, artistcd
WHERE artist.artistID = "$ArtistID2";
$query = mysqli_query($connect, $sql) or die("Error: ".mysqli_error($connect));;
$name = mysqli_fetch_assoc($query);
echo "<p>" . $name["artistID"] . $name["artistName"] . "</p>";
?>
<table width="70%" cellpadding="5" cellspace="5">
<tr>
<th>Genre</th>
<th>CD Identification</th>
<th>Title</th>
<th>Price</th>
</tr>
<?php
while ($row = mysqli_fetch_assoc($query)) {
echo "<tr>";
echo "<td>" . $row['cdGenre']. "</td>";
echo "<td>" . $row['cdID']. "</td>";
echo "<td>" . $row['cdTitle']. "</td>";
echo "<td>" . $row['cdPrice']. "</td>";
echo "</tr>";
}
?>
<table width="70%" cellpadding="5" cellspace="5">
</table>
<?php
$sql = "SELECT artist.artistName, artistcd.artistID, artistcd.cdID, artistcd.cdTitle, artistcd.cdGenre, artistcd.cdPrice
FROM artist, artistcd
WHERE artist.artistID = "$ArtistID3";
$query = mysqli_query($connect, $sql) or die("Error: ".mysqli_error($connect));;
$name = mysqli_fetch_assoc($query);
echo "<p>" . $name["artistID"] . $name["artistName"] . "</p>";
?>
<table width="70%" cellpadding="5" cellspace="5">
<tr>
<th>Genre</th>
<th>CD Identification</th>
<th>Title</th>
<th>Price</th>
</tr>
<?php
while ($row = mysqli_fetch_assoc($query)) {
echo "<tr>";
echo "<td>" . $row['cdGenre']. "</td>";
echo "<td>" . $row['cdID']. "</td>";
echo "<td>" . $row['cdTitle']. "</td>";
echo "<td>" . $row['cdPrice']. "</td>";
echo "</tr>";
}
?>
<table width="70%" cellpadding="5" cellspace="5">
</table>
Another way would be to query once for all the artists, and build the 3 tables by filtering the artists right from your associative array. But as you say you are just starting, i think this solution will do it.