<?php
class addressdb{
    public function all_country(){
        include 'configuration.php';
        $result=$pdo->prepare('call select_country_state_city_name("country", "no","no")');
        $result->execute();
        $pdo=null;
        //print_r($result);
        return $result;
    }
    public function all_state($countrycode){
        include 'configuration.php';
        $result=$pdo->prepare('call select_country_state_city_name("state", "no","'.$countrycode.'")');
        $result->execute();
        $pdo=null;
        //print_r($result);
        return $result;
    }
    public function all_city($statecode){
        include 'configuration.php';
        $result=$pdo->prepare('call select_country_state_city_name("city", "no","'.$statecode.'")');
        $result->execute();
        $pdo=null;
       // print_r($result);
        return $result;
    }
    public function country_name($countrycode){
        include 'configuration.php';
        $result=$pdo->prepare('call select_country_state_city_name("country", "yes","'.$countrycode.'")');
        $result->execute();
        $pdo=null;
        //print_r($result);
        return $result;
    }
    public function state_name($statecode){
        include 'configuration.php';
        $result=$pdo->prepare('call select_country_state_city_name("state", "yes","'.$statecode.'")');
        $result->execute();
        $pdo=null;
        //print_r($result);
        return $result;
    }
    public function city_name($citycode){
        include 'configuration.php';
        $result=$pdo->prepare('call select_country_state_city_name("city", "yes","'.$citycode.'")');
        $result->execute();
        $pdo=null;
       // print_r($result);
        return $result;
    }
}
?>