title: delete row with ajax function and php
body: <p>i have a table with mysql Data,i add a trash button and i want remove each row when trash button is clicked with ajax function,
  this is my html:</p>
  
  <pre><code>  &lt;table border="1"&gt;
      &lt;?php
  $sql ="SELECT * FROM music";
  $result = mysql_query($sql) or die(mysql_error());
  
  while($row = mysql_fetch_object($result)){
  
      echo '&lt;tr&gt;&lt;td&gt;'.$row-&gt;file_name.'&lt;/td&gt;&lt;td&gt;'.$row-&gt;composer.'&lt;/td&gt;&lt;td&gt;'.$row-&gt;lyric.'&lt;/td&gt;&lt;td&gt;'.$row-&gt;music_thumb.'&lt;/td&gt;&lt;td&gt;'.'
  
      &lt;a href="#" id="'.$row-&gt;msuic_id.'" class="trash" &gt;
      جذف کردن
      &lt;/a&gt;
  
      '.'&lt;/td&gt;&lt;/tr&gt;';
      }
  
  ?&gt;
    &lt;/table&gt;
  </code></pre>
  
  <p>and my ajax function here:</p>
  
  <pre><code>$(function(){
          $('.trash').click(function(){
              var del_id= $(this).attr('id');
              var $ele = $(this).parent().parent();
              $.ajax({
                  type:'POST',
                  url:'delete.php',
                  data:del_id,
                  success: function(data){
                      if(data=="YES"){
                          $ele.fadeOut().remove();
                          }else{
                              alert("can't delete the row")
                              }
                      }
  
                  })
              })
      });
  </code></pre>
  
  <p>and also my "delete.php" page here:</p>
  
  <pre><code>&lt;?php
  include('../db_inc.php');
  $music_number = "POST['del_id']";
  echo '$music_number';
  $qry = "DELETE FROM music WHERE msuic_id ='$music_number'";
  $result=mysql_query($qry);
  
  ?&gt;
  </code></pre>
  
  <p>i think my problem is ajax function;
  thanks</p>