diff --git a/.idea/ders.iml b/.idea/ders.iml
new file mode 100644
index 0000000..c956989
--- /dev/null
+++ b/.idea/ders.iml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..a338382
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
new file mode 100644
index 0000000..2d91f2f
--- /dev/null
+++ b/.idea/workspace.xml
@@ -0,0 +1,232 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+ DEFINITION_ORDER
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1521739010457
+
+
+ 1521739010457
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/README.md b/README.md
index d16e2c9..a9c2959 100644
--- a/README.md
+++ b/README.md
@@ -1,2 +1,2 @@
-# php-pdo-mysql-bolge-il-ilce
+# Dinamik bölge, il ve ilçe combobox uygulaması
PHP PDO ile MySQL veritabanından Bölge, İl ve ilçe bilgilerini çekerek dinamik combobox uygulaması yapmak.
diff --git a/ajax.php b/ajax.php
new file mode 100644
index 0000000..589e609
--- /dev/null
+++ b/ajax.php
@@ -0,0 +1,24 @@
+getBolgeList();
+ break;
+
+ case "il":
+ $db=new dbConn();
+ $bolge=$_POST["name"];
+ return $db->getIlList($bolge);
+ break;
+
+ case "ilce":
+ $db=new dbConn();
+ $il=$_POST["name"];
+ return $db->getIlceList($il);
+ break;
+}
\ No newline at end of file
diff --git a/dbConn.php b/dbConn.php
new file mode 100644
index 0000000..65fb89f
--- /dev/null
+++ b/dbConn.php
@@ -0,0 +1,72 @@
+getMessage();
+ }
+ }
+
+ //Bölgeleri getiren fonksiyon
+ public function getBolgeList()
+ {
+ $data=array();
+ $query = self::$db->query("SELECT DISTINCT bolge from ilveilceler", PDO::FETCH_ASSOC);
+ if($query->rowCount())
+ {
+ foreach ($query as $row)
+ {
+ $data[]=$row["bolge"];
+ }
+ }
+ echo json_encode($data);
+ }
+
+
+ //İlleri getiren fonksiyon
+ public function getIlList($bolge){
+ $data=array();
+ $query = self::$db->prepare("SELECT DISTINCT il FROM ilveilceler WHERE bolge=:bolge");
+ $query->execute(array(":bolge"=>$bolge));
+ if($query->rowCount())
+ {
+ foreach ($query as $row)
+ {
+ $data[]=$row["il"];
+ }
+ }
+ echo json_encode($data);
+ }
+
+
+ //İlçeleri getiren fonksiyon
+ public function getIlceList($il){
+ $data=array();
+ $query = self::$db->prepare("SELECT DISTINCT ilce FROM ilveilceler WHERE il=:il");
+ $query->execute(array(":il"=>$il));
+ if($query->rowCount())
+ {
+ foreach ($query as $row)
+ {
+ $data[]=$row["ilce"];
+ }
+ }
+ echo json_encode($data);
+ }
+}
\ No newline at end of file
diff --git a/index.php b/index.php
new file mode 100644
index 0000000..d3ef799
--- /dev/null
+++ b/index.php
@@ -0,0 +1,86 @@
+
+
+
+
+ İl ilçe PDO
+
+
+
+
+
+
+
+
+
PHP PDO ve MySQL ile il ilçe seçme
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file