Compare commits

..

2 commits

Author SHA1 Message Date
79b722bd30 a 2023-09-11 13:56:00 +02:00
d8f14e6a3a a 2023-09-11 13:31:24 +02:00
2 changed files with 78 additions and 0 deletions

View file

@ -0,0 +1,50 @@
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="description"
content="Wylazowski Klasa 5D2">
<title>Strona Główna</title>
<style>
td {
padding: 5px;
}
</style>
</head>
<body>
<h2 align="center">Baza danych Wylazowski, Klasa 5D2</h2>
<h3 align="center">Tu wstawiamy nasz kod</h3>
<table cellspacing="0" cellpadding="0" border="1" style="width: 90%;" align="center">
<tr bgcolor="#A000FF">
<td>ID</td>
<td>NAZWISKO</td>
<td>IMIĘ</td>
<td>USER ID</td>
<td>UWAGI</td>
<td>DATA REJESTRACJI</td>
</tr>
<?php
$conn = mysqli_connect('localhost','root','','baza_testowa');
$query = "SELECT emp.id,
emp.first_name,
emp.last_name
FROM emp
WHERE emp.last_name LIKE 'n%';";
$result = mysqli_query($conn, $query);
while ($row = mysqli_fetch_array($result))
{
echo '<tr><td>';
printf("%d", $row['id']);
echo '</td><td>';
printf("%s", $row['last_name']);
echo '</td><td>';
printf("%s", $row['first_name']);
echo '</td></tr>';
}
?>
</table>
</body>
</html>

View file

@ -0,0 +1,28 @@
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="description"
content="Wylazowski Klasa 5D2">
<title>Strona Główna</title>
</head>
<body>
<h2 align="center">Baza danych Wylazowski, Klasa 5D2</h2>
<h3 align="center">Tu wstawiamy nasz kod</h3>
<?php
$conn = mysqli_connect('localhost','root','','baza_testowa');
$query = "SELECT emp.id,
emp.first_name,
emp.last_name
FROM emp
WHERE emp.last_name LIKE 'n%';";
$result = mysqli_query($conn, $query);
while ($row = mysqli_fetch_array($result))
{
printf("%d", $row['id']);
printf("%s", $row['last_name']);
printf("%s", $row['first_name']);
}
?>
</body>
</html>