<!DOCTYPE html>
<html>
    <head>
        <title>Produkty</title>
        <meta charset="UTF-8" />
    </head>
    
<body>

    <h1>Lista rekordów</h1>
    
    <?php
    
        include('db_connect.php');
        
        if($result = $mysqli->query("SELECT * FROM autorzy ORDER BY IDAutor")){
            
            if($result->num_rows > 0){
                
                echo "<table border='1' cellpadding='10'>";
                
                echo "<tr><th>IDautora</th><th>Imię</th><th>Nazwisko</th></tr>";
                
                while($row = $result->fetch_object()){
                    echo "<tr>";
                    echo "<td>" . $row->IDAutor . "</td>";
                    echo "<td>" . $row->Imie. "</td>";
                    echo "<td>" . $row->Nazwisko . "</td>";
        
                    echo "</tr>";
                }
                
                echo "</table>";
                
            } else {
                echo "Brak rekordów";
            }
            
        } else {
            echo "Błąd: " . $mysqli->error;
        }
        
        $mysqli->close();
    
    ?>
    
    <a href="records.php">Dodaj nowy produkt</a>

</body>

</html>