Powiedzcie mi proszę co robię źle mam taki kod w php
<html>
<head>
<title>User Table</title>
<style type="text/css">
table {
border-collapse:collapse;
width:100%;
color:#eb4034;
font-family:monospace;
font-size:25px;
text-align:left
}
th {
background-color:#eb4034;
color:white;
}
tr:nth-child(even) {background-color:#ededed}
</style>
</head>
<body>
<table>
<tr>
<th>IDosoby</th>
<th>Imie</th>
<th>Nazwisko</th>
<th>Wiek</th>
<th>Hobby</th>
</tr>
<?php
$conn = mysqli_connect("localhost","root","","osoby");
if ($conn->connect_error){
die("Connection failder:". $conn->connect_error);
}
$sql= "Select * from osoba";
$result = $conn -> query($sql);
if($result->num_rows>0){
while ($row = $result -> fetch_assoc()){
echo "<tr>
<td>".$row["IDosoby"].
"</td><td>" . $row["Imie"].
"</td><td>". $row["Nazwisko"].
"</td><td>".$row["Wiek"].
"</td><td>" . $row["Hobby"].
"</td></tr>";
}
echo "</table>";
}
else{
echo "0 result";
}
$conn->close();
?>
</table>
</body>
</html>
ten kod php pięknie wyświetla tabelkę, ale chcę tą tabelę w html, aby móc zrobić do niej a hrefa :) Chcę taką tabelkę 1:1 w HTML. Szukam, szukam i każdy pokazuje jak pokazać takie dane w html który jest w php. A ja chcę to pokazać w html, aby móc zrobić do niego z podstrony a href
<html>
<head>
<title>User Table</title>
<style type="text/css">
table {
border-collapse:collapse;
width:100%;
color:#eb4034;
font-family:monospace;
font-size:25px;
text-align:left
}
th {
background-color:#eb4034;
color:white;
}
tr:nth-child(even) {background-color:#ededed}
</style>
</head>
<body>
<table>
<tr>
<th>IDosoby</th>
<th>Imie</th>
<th>Nazwisko</th>
<th>Wiek</th>
<th>Hobby</th>
</tr>
</table>
</body>
</html>