Dateien hochladen nach „“
...
This commit is contained in:
17
apprentice_add.php
Normal file
17
apprentice_add.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
require './db_config.php';
|
||||
$post = file_get_contents('php://input');
|
||||
$post = json_decode($post);
|
||||
|
||||
$sql = "INSERT INTO apprentice (firstname, lastname, groupid, sex, date_of_birth, date_joined, date_leave) VALUES ('" . $post->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);
|
||||
?>
|
||||
|
Reference in New Issue
Block a user