title: how to create a multiple dependent drop down list using php and save the data in mysql database?
body: <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns = "http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
  &lt;meta http-equiv = "Content-Type" content = "text/html; charset=iso-8859-1" /&gt;
  &lt;title&gt;Sections Demo&lt;/title&gt;
  &lt;script type = "text/javascript" src = "http://ajax.googleapis.com/
  ajax/libs/jquery/1.4.2/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
      $(document).ready(function()
      {
          $(".state").change(function()
          {
              var id = $(this).val();
              var dataString = 'id=' + id;
              $.ajax
              ({
                  type: "POST",
                  url: "ajax_city.php",
                  data: dataString,
                  cache: false,
                  success: function(html)
                  {
                      $(".district").html(html);
                  }
              });
          });
      });
  &lt;/script&gt;
  &lt;style&gt;
      label
      {
          font-weight:bold;
          padding:10px;
      }
  &lt;/style&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
      &lt;div style="margin:80px"&gt;
          &lt;label&gt;state :&lt;/label&gt; &lt;select name="country" class="country"&gt;
              &lt;option selected="selected"&gt;--Select state--&lt;/option&gt;
              &lt;?php
                  include('db.php');
                  $sql = mysql_query("select id,data from states where weight='1'");
  
  
  
                  while ($row = mysql_fetch_array($sql)) {
                      $id = $row['id'];
                      $data = $row['data'];
                      echo '&lt;option value="' . $id . '"&gt;' . $data . '&lt;/option&gt;';
                  }
              ?&gt;
          &lt;/select&gt; &lt;br/&gt;&lt;br/&gt;
          &lt;label&gt;district :&lt;/label&gt; &lt;select name="district" class="district"&gt;
              &lt;option selected="selected"&gt;--Select district--&lt;/option&gt;
          &lt;/select&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I'm trying to create a multiple drop down list, where each drop down list is dependent on the previous drop down list... for example: 
  i want to create a drop down list of states, when select a state, the district present in that state should get listed in the next drop down list and selected data should get stored in the database... could anybody help me to sort it out??? 
  thanx in advance... :-)</p>