21 lines
563 B
PHP
21 lines
563 B
PHP
|
<?php
|
||
|
|
||
|
require 'db_config.php';
|
||
|
|
||
|
$sql = "SELECT a.apprenticeid, firstname, lastname, groupname, examid, date_of_exam, acquired FROM `apprentice` a left join apprenticeexam e on a.apprenticeid=e.apprenticeid left join gruppe g on a.groupid = g.groupid";
|
||
|
|
||
|
$result = $mysqli->query($sql);
|
||
|
if ($result != null)
|
||
|
{
|
||
|
while($row = $result->fetch_assoc()){
|
||
|
$json[] = $row;
|
||
|
}
|
||
|
|
||
|
$data = $json;
|
||
|
$result = mysqli_query($mysqli,$sql);
|
||
|
echo json_encode($data);
|
||
|
}
|
||
|
else
|
||
|
echo json_encode(['success' => 0, 'message' => 'keine Daten empfangen!']);
|
||
|
?>
|