File: /var/www/nclive/technc/upload_file_data.php
<?php
header("Access-Control-Allow-Origin: *");
header('Content-Type: application/json');
include 'config.php';
$query="SELECT up.id,ex.exam_name,up.title,up.upload_file FROM sp_exam_uploads as up LEFT JOIN sp_exam as ex on ex.exam_id=up.exam_id order by up.id desc";
$sql=$db->prepare($query);
$sql->execute();
while($row=$sql->fetch()){
$path="http://naukriconnect.com/technc/uploads/".$row['upload_file'];
$nestedData=array();
$nestedData["id"] =$row['id'];
$nestedData["exam_name"] =$row['exam_name'];
$nestedData["title"] =$row['title'];
$nestedData["file_path"] =$path;
$data[] = $nestedData;
}
echo json_encode($data); // send data as json format
?>