bildungdb/apprentice_list.php

25 lines
523 B
PHP
Raw Normal View History

2023-01-08 23:58:21 +01:00
<?php
require './db_config.php';
$sql = "SELECT apprenticeid, firstname, lastname, a.groupid, groupname, sex, date_of_birth, date_joined, date_leave ";
$sql .= "FROM apprentice a left join gruppe g on a.groupid = g.groupid ";
$result = $mysqli->query($sql);
if ($result != null)
{
while($row = $result->fetch_assoc()){
$json[] = $row;
}
$data['apprentice'] = $json;
$result = mysqli_query($mysqli,$sql);
echo json_encode($data);
}
else
echo json_encode("keine Daten empfangen!");
?>