this is the code that I am using for update or create but when starting for edit or create and the bottom name changed to update nothing is working till pressing cancel.
<?php
require_once 'config.php';
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
header('Content-Type: application/json');
}
$inputJSON = file_get_contents('php://input');
$paredData = json_decode($inputJSON, TRUE);
$pn= $paredData["filed1"];
$sc = $paredData["filed2"];
/**
* connect to database and execute sqql command
*/
$tableName = '********' ;
$conn = oci_connect($dbuser, $dbpassword , $dbhost.':'.$dbport.'/'.$dbname);
$sqlStatement = 'insert into '.$tableName.'(pn, SC) VALUES ('.$PN.', '.$sc.'.');';
echo $sqlStatement;
$retrive = oci_parse($conn , $sqlStatement);
$execute = oci_execute($retrive);
if ($execute){
echo 'successful';
oci_commit($conn);
LogerFile($databaseLogEvents,$partNo.' inserted Succesfuly. ');
} else {
echo ' error';
oci_rollback($conn);
LogerFile($errorLogEvents,$partNo.' has been Rolleback something went wrong for inserting. ');
}