<?php
 
include 'dbconfig.php';
 
// Create connection

$idno=$_POST['idno'];
$qty=$_POST['qty'];
$disc_val=$_POST['disc_val'];

//echo $notrans;
 
$conn = mysqli_connect($servername, $username, $password, $dbname);
 
// Check connection
 
if (!$conn) {
 
    die("Connection failed: " . mysqli_connect_error());
 
}
 
 
//TotSubTot
 
$res = mysqli_query($conn, "update Trans1ret set qty='$qty',disc_val='$disc_val' where idno='$idno' ");
 
$res_check = mysqli_query($conn, "select idno from Trans1ret  where idno='$idno' "); 

if (mysqli_num_rows($res_check)>0)
{
    $result['message']='ok';
}else
{
     $result['message']='failed';
}
 
 
echo json_encode($result);
 
mysqli_close($conn);
 
?>
