<?php
include("../../db.php");
//header("Access-Control-Allow-Origin: * ");
header('Content-Type: application/json');
 
 $sql = $db->getRows("select * from app_subject");
       
// 	$result = mysql_query($sql);
//   while ($row = mysql_fetch_assoc($result)) 	
    foreach($sql as $row)
	{
    	$jsonn[]=array("id" =>$row['id'],"class" =>$row['class'],"subject" =>$row['subject']);
 	    $json['status']=1;
		$json['msg']="successful";
		$json['data']=$jsonn;
	//	$json['section']=$jsonc;
	    
	}
	
if(empty($json))
	{  
     $json['status']=0;	
     	$json['msg']="data not found";
	}
echo json_encode($json);	

?>