bildungdb/api/modul.php

20 lines
361 B
PHP
Raw Normal View History

2023-01-08 22:45:34 +01:00
<?php
require './db_config.php';
$sql = "SELECT * FROM `module`";
$result = $mysqli->query($sql);
if ($result != null) {
while ($row = $result->fetch_assoc()) {
$json[] = $row;
}
$data['modul'] = $json;
$result = mysqli_query($mysqli, $sql);
echo json_encode($data);
} else
echo "<br><br>keine Daten empfangen!<br><br>";
?>