From 143c969250c1903de90efadcce76b595335f46ce Mon Sep 17 00:00:00 2001 From: danielk Date: Sun, 8 Jan 2023 23:58:21 +0100 Subject: [PATCH] =?UTF-8?q?Dateien=20hochladen=20nach=20=E2=80=9E=E2=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... --- apprentice_add.php | 17 +++++++++++++++++ apprentice_list.php | 24 ++++++++++++++++++++++++ db_config.php | 16 ++++++++++++++++ group_add.php | 16 ++++++++++++++++ group_data.php | 27 +++++++++++++++++++++++++++ 5 files changed, 100 insertions(+) create mode 100644 apprentice_add.php create mode 100644 apprentice_list.php create mode 100644 db_config.php create mode 100644 group_add.php create mode 100644 group_data.php 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!

"; +?>