Venue details

[insert_php]
if (get_query_var(“ID”)) {
$ID = get_query_var(“ID”);
}

$db=mysqli_connect(“localhost”,”kristoflodewijk”,”Gd52CDpi”,”kristoflodewijk”);
if (mysqli_connect_errno($db))
{
echo “Failed to connect to MySQL: ” . mysqli_connect_error();
}

$sql_q = “SELECT * FROM music_venues WHERE ID='”.$ID.”‘”;

$result = mysqli_query($db,$sql_q);

$row = mysqli_fetch_array($result);

echo “

” ;

$city_q =”SELECT * FROM music_cities WHERE ID='”.$row[‘city_ID’].”‘”;
$city = mysqli_query($db, $city_q);
$city_info = mysqli_fetch_array($city);
echo “

“;

$country_q =”SELECT * FROM countries WHERE ID='”.$row[‘country_ID’].”‘”;
$country = mysqli_query($db, $country_q);
$country_info = mysqli_fetch_array($country);
echo “

“;

echo “

Name “.$row[‘name’] .”
City: “.$city_info[‘name’].”
Country: “.$country_info[‘name’].”
Website: Link

“;

[/insert_php]

Concerts at this venue

[insert_php]
$db=mysqli_connect(“localhost”,”kristoflodewijk”,”Gd52CDpi”,”kristoflodewijk”);
if (mysqli_connect_errno($db))
{
echo “Failed to connect to MySQL: ” . mysqli_connect_error();
}

$sql_q = “SELECT * FROM music_concerts WHERE venue_ID = ‘”.$ID.”‘ ORDER BY date DESC”;
$result = mysqli_query($db,$sql_q);
$concert_count = $result->num_rows;

echo “There are “.$concert_count.” concerts in this venue listed in the database.”;
[/insert_php]

[insert_php]
$db=mysqli_connect(“localhost”,”kristoflodewijk”,”Gd52CDpi”,”kristoflodewijk”);
if (mysqli_connect_errno($db))
{
echo “Failed to connect to MySQL: ” . mysqli_connect_error();
}

$sql_q = “SELECT * FROM music_concerts WHERE venue_ID = ‘”.$ID.”‘ ORDER BY date DESC”;
$result = mysqli_query($db,$sql_q);

while($row = mysqli_fetch_array($result))
{
echo “

” ;
$band_q =”SELECT * FROM music_bands WHERE ID='”.$row[‘band_ID’].”‘”;
$band = mysqli_query($db, $band_q);
$band_info = mysqli_fetch_array($band);
echo “

“;
$more_info =”Click here“;
echo “

“;
}
[/insert_php]

Date Band More info
“.$row[‘date’] .” “.$band_info[‘name’].” “.$more_info.”