title: How to fetch data row by row from mysql table, queries coded in php, using jquery (AJAX)?
body: <p>I am a beginner in Ajax. I want to fetch data row from Subject Table consist of only one column Subject as varchar(100), defined in MySQL DB. Following is my php code.</p>
  
  <p>Data.php</p>
  
  <pre><code>&lt;?php
  
  $con=mysqli_connect("","root","root","DBTemp") or die("&lt;/br&gt; Error: " .mysqli_connect_error());
  
  $sql="select * from Subject";
  $result = mysqli_query($con,$sql);
  while($row = mysqli_fetch_assoc($result))
   {
      echo $row["SUBJECT"];
      //I Want This Value to Be received in my Jquery Page
      //So that i can take certain action based on each Subject.
      //For example creating a select box child elements,options.
   }
  ?&gt;
  </code></pre>
  
  <p>Jquery.js</p>
  
  <pre><code>$(document).ready(function()
   {
      var response='';
      $("body").ready(function()
       {
         $.ajax(
            {
              url: '/Data.php',
              type: 'GET'
              success: function(text)
                  {
                       response=text;
                  }
            });
       });
      $("body").append("&lt;select&gt; /*Get values here as options*/ &lt;/select&gt;");
   });
  </code></pre>
  
  <p>But The Desired action is getting values row by row like:-
  1st row value comes-> take certain action in jquery;
  2nd row value comes-> take sertain action..;
  .
  .
  so on.</p>