2024-11-08 11:55:09 +00:00
|
|
|
<?php
|
|
|
|
|
2024-11-13 13:47:17 +00:00
|
|
|
$polaczenie = mysqli_connect("localhost", "root", "", "db");
|
2024-11-08 11:55:09 +00:00
|
|
|
|
|
|
|
$kwerenda = mysqli_query($polaczenie, "SELECT * FROM paliwa ORDER BY id DESC LIMIT 3;");
|
|
|
|
|
|
|
|
$json = array();
|
|
|
|
|
|
|
|
while($row = mysqli_fetch_assoc($kwerenda)) {
|
|
|
|
$json [] = $row;
|
|
|
|
};
|
|
|
|
|
|
|
|
echo json_encode($json);
|
|
|
|
|
|
|
|
?>
|