<?php
include("../../db.php");
error_reporting(E_ALL);
header("Access-Control-Allow-Origin: * ");

$id = $_REQUEST['id'];

$chkphoto = $db->getVal("select file_name from exam_question where id='" . $id . "'");

if ($chkphoto != null) {

    unlink("../../uploads/exam_question/" . $chkphoto);

}

$flgUp = $db->delete("exam_question", "where id='$id'");

if ($flgUp != "") {
    echo json_encode(array('status' => 1, 'msg' => 'delete Successfully'));

} else {
    echo json_encode(array('status' => 0, 'msg' => 'image Not delete Please Try Again..!'));
}
