diff --git a/apprentice_add.php b/apprentice_add.php new file mode 100644 index 0000000..eb14201 --- /dev/null +++ b/apprentice_add.php @@ -0,0 +1,17 @@ +firstname . "','" . $post->lastname . "',"; +$sql .= $post->groupid . ", '" . $post->sex . "','" . $post->date_of_birth . "', '" . $post->date_joined . "',''"; +$result = $mysqli->query($sql); + +$sql = "SELECT * FROM apprentice Order by apprenticeid desc LIMIT 1"; +$result = $mysqli->query($sql); +$data = $result->fetch_assoc(); + +echo json_encode($data); +?> + diff --git a/apprentice_list.php b/apprentice_list.php new file mode 100644 index 0000000..539e44f --- /dev/null +++ b/apprentice_list.php @@ -0,0 +1,24 @@ +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!"); + +?> + diff --git a/db_config.php b/db_config.php new file mode 100644 index 0000000..f3a9370 --- /dev/null +++ b/db_config.php @@ -0,0 +1,16 @@ +groupname . "','" . $post->date . "')"; +$result = $mysqli->query($sql); + +$sql = "SELECT * FROM group Order by groupid desc LIMIT 1"; +$result = $mysqli->query($sql); +$data = $result->fetch_assoc(); + +echo json_encode($data); +?> + diff --git a/group_data.php b/group_data.php new file mode 100644 index 0000000..122069c --- /dev/null +++ b/group_data.php @@ -0,0 +1,27 @@ +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 "

keine Daten empfangen!

"; +?>