title: AJAX hover tooltip displays returned data only for first row in table
body: <p>I am sending data to a PHP page using AJAX, where the data is fetched from MySQL. Hovering over the <code>.payoudata</code> class sends its <code>data-id</code> value to PHP, and gets the result. It is displayed using <code>&lt;div id="PayoutData"&gt;</code> but it's only displaying results related to the first record. </p>
  
  <p>Here is my PHP code for generating the table:</p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;? while($srow = $stm-&gt;fetch(PDO::FETCH_ASSOC)) { ?&gt;
    &lt;tr&gt;
      &lt;td id="tooltip1"&gt;
        &lt;a href="#" class="payoudata" data-id="&lt;?php echo $srow['application_no']?&gt;"&gt;&lt;?php echo $srow['application_no']?&gt;
         &lt;span&gt;&lt;div id="PayoutData"&gt;&lt;/div&gt;&lt;/span&gt;
        &lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;  
  &lt;? } ?&gt;
  </code></pre>
  
  <p>and here's my jQuery code for fetching and displaying the tooltip:</p>
  
  <pre class="lang-js prettyprint-override"><code>$('.payoudata').hover(function(){
  
      var paydata =  $(this).attr("data-id");
  
      $.ajax({
          type:'post',
          url:'payout-emp-data.php',
          data:{paydata : paydata},
          success: function(paydataresult){
              $('#PayoutData').html(paydataresult);
              }
          });
      });
  </code></pre>
  
  <p>I am getting first record in this <code>&lt;div id="PayoutData"&gt;</code></p>
  
  <p>When I try to see the second record it's sending data and getting a result but unable to display it, as shown in the screenshots below. What might be a potential way of displaying the returned data?</p>
  
  <p>Screenshot of first record:</p>
  
  <blockquote>
    <p><a href="https://i.stack.imgur.com/tcnsa.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tcnsa.jpg" alt="Screenshot"></a></p>
  </blockquote>
  
  <p>Screenshot of second record:</p>
  
  <blockquote>
    <p><a href="https://i.stack.imgur.com/h0W93.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/h0W93.jpg" alt="Screenshot"></a></p>
  </blockquote>