44 lines
911 B
PHP
44 lines
911 B
PHP
|
|
<?php
|
|
include('includes/config/config.php');
|
|
include('log_entry.php');
|
|
include("includes/functions.php");
|
|
$where_key = $_REQUEST['key'];
|
|
//error_log('select file');
|
|
|
|
|
|
switch($where_key)
|
|
{
|
|
|
|
case 'category_name':
|
|
|
|
|
|
$where_val = $_REQUEST['key_val'];
|
|
|
|
$query = "select * from staff_category_master where category_name = '".$where_val."' ";
|
|
error_log($query);
|
|
if (!$result = @mysqli_query($conn,$query)) {
|
|
// error_log("error in query checking unique value:".mysql_error()." Query:".$query);
|
|
exit(mysqli_error($conn));
|
|
}else{
|
|
$data = array();
|
|
if(mysqli_num_rows($result) > 0) {
|
|
while ($row = @mysqli_fetch_assoc($result)) {
|
|
$data = $row;
|
|
}
|
|
}else
|
|
{
|
|
$data['status'] = 200;
|
|
$data['message'] = "Data not found!";
|
|
error_log($data['message']);
|
|
}
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
}//end of switch
|
|
echo json_encode($data);
|
|
?>
|