0

->When i call this code using ajax,it's not work proper

->Result is only for one category other category result not display,how can i solve this?

  $city_id=$_GET['id'];


//Get Area
$area_qry="SELECT * FROM tbl_area where city_id IN ('".$city_id."') ";


$area_res=mysql_query($area_qry);

        echo "<option value=''>-- Select City Area --</option>";

   while($area_row=mysql_fetch_array($area_res)){

            echo  "<option value='".$area_row['area_id']."'>".$area_row['area_name']."</option>";

        }
nkuldip
  • 43
  • 10

1 Answers1

0

Solve myself,Here is updated code

$city_id=$_GET['id'];


//Get Area
$area_qry="SELECT * FROM tbl_area where city_id IN ($city_id) ";


$area_res=mysql_query($area_qry);

        echo "<option value=''>-- Select City Area --</option>";

   while($area_row=mysql_fetch_array($area_res)){

            echo  "<option value='".$area_row['area_id']."'>".$area_row['area_name']."</option>";

        }
nkuldip
  • 43
  • 10