28 lines
585 B
PHP
28 lines
585 B
PHP
|
<?php
|
||
|
require 'db_config.php';
|
||
|
|
||
|
if(isset($_GET["id"]))
|
||
|
{
|
||
|
$id = $_GET["id"];
|
||
|
$sql = "SELECT `groupid`, `groupname`, `date_started`, `Anmerkung` FROM `gruppe` WHERE groupid = " . $id . ";";
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
$sql = "SELECT `groupid`, `groupname`, `date_started`, `Anmerkung` FROM `gruppe`;";
|
||
|
}
|
||
|
|
||
|
$result = $mysqli->query($sql);
|
||
|
if ($result != null)
|
||
|
{
|
||
|
while($row = $result->fetch_assoc()){
|
||
|
$json[] = $row;
|
||
|
}
|
||
|
|
||
|
$data['data'] = $json;
|
||
|
$result = mysqli_query($mysqli,$sql);
|
||
|
echo json_encode($data);
|
||
|
}
|
||
|
else
|
||
|
echo "<br><br>keine Daten empfangen!<br><br>";
|
||
|
?>
|