This commit is contained in:
Mikolaj 2019-11-18 20:43:33 +01:00
parent 80d489c49d
commit 220b56af85
2 changed files with 75 additions and 0 deletions

55
index.php Normal file
View File

@ -0,0 +1,55 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="Stylesheet" href="style.css">
</head>
<body>
<?php
$conn = new mysqli("localhost", "root", "", "komputery") or die("Błšd");
$wynik = $conn->query("SELECT * FROM parametry WHERE Id = 1 ");
echo "<h1>Dane twojego komputera: </h1>";
if($wynik->num_rows > 0){
echo "<table>";
echo "<tr>";
echo "<th>Id</th>";
echo "<th>Procesor</th>";
echo "<th>Plyta_Glowna</th>";
echo "<th>Pamiec_Ram</th>";
echo "<th>Dysk</th>";
echo "<th>Karta_Graficzna</th>";
echo "</tr>";
while( $wiersz = $wynik->fetch_assoc() ){
echo "<tr>";
echo "<td>" . $wiersz["Id"] . "</td>";
echo "<td>" . $wiersz["Procesor"] . "</td>";
echo "<td>" . $wiersz["Plyta_Glowna"] . "</td>";
echo "<td>" . $wiersz["Pamiec_Ram"] . "</td>";
echo "<td>" . $wiersz["Dysk"] . "</td>";
echo "<td>" . $wiersz["Karta_Graficzna"] . "</td>";
echo "</tr>";
}
echo "</table>";
}else {
echo "Nie ma nic w bazie danych";
}
$conn->close();
?>
</body>
</html>

20
style.css Normal file
View File

@ -0,0 +1,20 @@
body {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10pt;
color: black;
background-color: #80B8E8;
margin: 6mm;
}
p {
text-align: justify;
}
pre, code {
font-size: 8pt;
}
td {
border: solid #000 1px;
padding: 5px;
border-spacing: 25mm;
}