ok
Direktori : /home2/selectio/public_html/y1jobportal.in/apps-api/ |
Current File : /home2/selectio/public_html/y1jobportal.in/apps-api/get-state.php |
<?php include_once('config/config.php'); include_once('config/custom-functions.php'); include 'config/send-sms.php'; $fn = new custom_functions(); date_default_timezone_set('Asia/Kolkata'); $today=date('d-m-Y h:m:s A'); try{ $sql="SELECT id,state_name as name FROM state where id!=0 and status=1"; $statement = $pdo->prepare($sql); $statement->execute(); $res = $statement->fetchAll(PDO::FETCH_ASSOC); if (!empty($res)) { $response['error'] = false; $response['message'] = "State fatched successfully."; $response['data'] = $res; } else { $response['error'] = true; $response['message'] = "Something went wrong, please try again leter."; } $pdo = null; print_r(json_encode($response)); }catch(Exception $e){ $response["error"] = true; $response["status_code"] = '403'; $response["status"] = 'Forbidden'.$e; $pdo = null; print_r(json_encode($response)); return 0; } ?>