Send PHP variable to AJAX

Send PHP variable to AJAX

Hi guys, 

I send variable to AJAX for editing some data in table, but every time when I clicked in any rows JS receive my first clicks variable 
  1. <table id="link-table" cellpadding="0" cellspacing="0" border="0" class="display  dt2">
  2. <thead>
  3. <tr>
  4. <th>a</th>
  5. <th>b</th>
  6. </tr>
  7. </thead>
  8. <tbody>
  9. <?php
  10. $stmt = "SELECT a, b FROM ast.cdr ORDER BY a desc";
  11. $result = mysql_query( $stmt, $conn );
  12. while($row = mysql_fetch_array($result, MYSQL_ASSOC)){
  13. $id= $row['src'];
  14.                
  15. ?>
  16. <tr class="gradeX">
  17.                
  18.                
  19. <td><span name="<?php echo $row['a'];?>"><?php echo $row['a'];?><span></span></td>
  20. <td><?php echo $row['billsec']?>.сек</td>
  21. <td>
  22. <a href="#" class="sepV_a fd2" title="Edit"><img src="img/ico/pencil_gray.png" alt="" /></a>
  23. <a href="#" class="sepV_a chist" title="View"><img src="img/ico/preview_gray.png" alt="" /></a>
  24. <a href="#" class="sepV_a delete_button" title="Del"><img src="img/ico/trashcan_gray.png" alt="" /></a>
  25. </td>
  26. </tr>
  27. <?php
  28. }
  29. ?>
  30. </tbody>
  31. </table>
and my JS code 
  1. $(".fd2").fancybox({
  2.                 href : 'search_result.php',
  3. ajax : {
  4. type : "POST",
  5.                 cache : false,
  6.                 data:{search_item : name},
  7.                 success: function(result)
  8.                     {
  9.                     console.log(result);
  10.                     }
  11. },
  12. });