<?php
$host = "localhost";
$user = "xxxxxxx"; //parameters obscured by me
$pw = "xxxxxxxxx;
$db = "xxxxxxxxx";
$con = mysqli_connect($host,$user,$pw) or die(mysqli_error());
mysqli_select_db($con,$db) or die(mysqli_error());
mysqli_query($con,"SET CHARACTER SET utf8");
mysqli_query($con,"SET NAMES 'utf8'");
$json = file_get_contents("php://input");
$jsall = array();
$jsone = array();
$jsall=json_decode($json, true);
$jsone=$jsall[0];
$Action = $jsone["Action"];
switch ($Action)
{
Case "InsertPerson":
$pname=stripslashes(mysqli_real_escape_string($con,$jsone["pname"]));
$pbirthdate=stripslashes(mysqli_real_escape_string($con,$jsone["pbirthdate"]));
$stmt = $con->prepare("INSERT INTO Comande (Post,Id) VALUES (?,?)");
$rc=$stmt->bind_param($pname, $pbirthdate);
$rc=$stmt->execute();
break;
default:
print json_encode ("Error: Function not defined (" . $action . ")");
}
?>