PCQRSCANER/index.php
2019-11-18 20:43:33 +01:00

55 lines
1.2 KiB
PHP

<!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>