0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 18.225.55.42


Current Path : /var/www/html/studentportal_wait/src/
Upload File :
Current File : /var/www/html/studentportal_wait/src/saveansbookno.php

<?php

include("database.php");

$UNIVCODE  = $_SESSION['UNIVCODE'];
$regno  = $_SESSION['REGNO'];
$qpcode = $_POST['qpcode'];
$ansbookno = $_POST['ansbookno'];

$query = "insert into ansstud(fregno,fdegree,fqpcode,fansbookno,fyear,fexamtype)
select c.fregno,c.fdegree,s.fqpcode,'{$ansbookno}',c.fyear,c.fexamtype from canddet c inner join subject s on 
c.fdegree = s.fdegree and c.fexamno = s.fexamno and c.fsubcode = s.fsubcode where c.fregno = '{$regno}' 
and s.fqpcode = '{$qpcode}'
ON DUPLICATE KEY UPDATE fansbookno = '{$ansbookno}'";
$result = mysqli_query($conn,$query);


// $query = "update canddet cd, subject s set fansbook = '{$ansbookno}'
//     where cd.fdegree = s.fdegree and cd.fexamno = s.fexamno 
//     and cd.fsubcode = s.fsubcode
//     and s.fqpcode = '{$qpcode}' and cd.fregno = '{$regno}'";
// $result = mysqli_query($conn,$query);

if($result)
{
    $app['data'] = "Updated Successfully";
    $app['error_code'] = 0;
    echo json_encode($app);
}
else
{
	$app['data'] = "Updation Faiure";
	$app['error_code'] = -1;
	
	echo json_encode($app);
}
mysqli_close($conn);

?>