<?php
$country=$_POST['country'];
$data = array();
require 'config.php';
$sql= "select * from rdh_countries where country=:country";
$stmt = $pdo->prepare($sql);
$stmt->bindParam(':country', $country, PDO::PARAM_STR);
$stmt->execute();
$total = $stmt->rowCount();
if($total > 0){
while ($row = $stmt->fetchObject()) {
	
	$data['status'] = 'ok';
	$data['result'] = array(
          "country" => $row->country,
		  "idps" => $row->idps,
		  "idps_link" => $row->idps_link,
		  "refugees" => $row->refugees,
		  "refugees_link" => $row->refugees_link,
          "ims" => $row->ims,
		  "ims_link" => $row->ims_link,
        );
}
}
else{
        $data['status'] = 'err';
        $data['result'] = '';
    }
	//returns data as JSON format
    echo json_encode($data);
 ?>