<?php
include("../../db.php");
header('Content-Type: application/json');

$jsondata = $_POST['json'];

$status = 0;
$msg = 'Failed to update data';
$array = array();

$ext = array();

if($jsondata != null && $jsondata != ''){

    $decode = json_decode($jsondata, true);

    foreach ($decode as $item){
        $db->updateAry("student", array("medium" => $item['selection']), " where idno = '$item[idno]' ");
    }

    $status = 1;
    $msg = 'House updated successfully';

}

$array['status'] = $status;
$array['msg'] = $msg;

echo json_encode($array);
