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

$session = $_GET['session'];
$checkdate = $db->getRows("select * from calendar WHERE session='$session'");

// while ($rowc = mysql_fetch_assoc($checkdate)) 
foreach($checkdate as $rowc)
{
    $jsonn[] = $rowc;
}

if (count($jsonn) > 0) {
    $status = 1;
    $msg = "Data found successfully.";
} else {
    $msg = "Something went wrong. Please try again.";
}

echo json_encode(array('status' => $status,'data'=>($jsonn), 'msg' => "$msg"));