Show Code: index.php

<?php include 'session.php'?>
<!DOCTYPE html>
<html>

<head>
    <title>Alexandria</title>
    <link href="style1.css" rel="stylesheet" type="text/css">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>

<body>
    <?php include 'nav.php'?>
    <?php include 'db-connect.php'?>
    <main>

        <?php
        
        
echo '<strong>Stats from Alexandria:</strong> ';
        
        
$sql='SELECT COUNT(*) FROM t_artists';
        
$result=mysqli_query($con,$sql);
        
$row=mysqli_fetch_row($result);
        echo 
' Artists: '.$row['0'];
        
        
$sql='SELECT COUNT(*) FROM t_pieces';
        
$result=mysqli_query($con,$sql);
        
$row=mysqli_fetch_row($result);
        echo 
' Art Pieces: '.$row['0'];
        
        
$sql='SELECT * FROM t_artists JOIN t_pieces ON artist_id=artist_fk ORDER BY RAND() LIMIT 1';
        
$result=mysqli_query($con,$sql);
        
$row=mysqli_fetch_row($result);
        echo 
'<h4>Highlighted Artist:</h4>  <h2>'.$row[2].'</h2> <img src="'.$row[3].'" width="280px">';
        echo 
'<span><h2>Biography:</h2>'.$row[4].'</span>'
?>

        <?php mysqli_close($con);  //Close Connection ?>


    </main>
</body>

</html>