title: Retrieve data from datatbase based on combo box selection
body: <p>i am trying to display values in text box from database based on combo box change.. i'm using following code,it doesn't work please help me.. the combo change value did not pass to abc.php from combo_example.php, if i'm trying to run abc.php separately it display error like "Undefined index: combo". </p>
  
  <p>combo_example.php</p>
  
  <pre><code>&lt;script&gt; src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
  $(document).ready()function(){
  $('#combo').change(function(){
  $.post("abc.php",{$combo:$(this.val() )},function(result){
  $("#textbox").val(result);
     });
   });
  });
  &lt;/script&gt;
  
  &lt;form&gt;
       &lt;select name="combo" id="combo"&gt;
           &lt;option value=""&gt;-- Select --&lt;/option&gt;
           &lt;?php  
  
              $query="select * from combo_example";
                  $result=mysql_query($query);
                  while ($row = mysql_fetch_array($result)) {
                 echo '&lt;option value = "' . $row['product_name'] . '"&gt;' . 
                 $row['product_name'] . '&lt;/option&gt;';
                  }
            ?&gt;
      &lt;/select&gt;
      &lt;input type="textbox" id="textbox" value="&lt;?php $row['mrp']; ?&gt;" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>abc.php</p>
  
  <pre><code>&lt;?php
   $product_name= $_POST['combo'];
   $rs =mysql_query("SELECT mrp FROM combo_example WHERE product_name='$product_name'");
    if($rs &amp;&amp; mysql_num_rows($rs)){
     $row = mysql_fetch_object($rs);
     echo $row-&gt;mrp;
    }
  ?&gt;
  </code></pre>