title: JQGrid : delete a row in jqgrid not working
body: <p>I have a jqgrid in my php file . I want to perform add,edit,delete functionality in that grid.
  The following is the code for JQGrid  </p>
  
  <pre><code> &lt;script type="text/javascript"&gt;
              $(function() {
  
                  $("#list1").jqGrid({
                      url:'testJson.php',
                      datatype: 'json',
                      colNames:['sno','occasion','greeting'],
                      colModel :[ 
  
                          {name:'sno', index:'sno',width: 100,searchoptions: { sopt: ['eq', 'ne','cn']},edittype:'text',edit:true,editable:true}, 
                          {name:'occasion', index:'occasion',search: false,width: 120,edittype:'text',edit:true,editable:true}, 
                          {name:'greeting', index:'greeting',width: 120,edittype:'text',edit:true,editable:true,searchoptions: { sopt: ['eq', 'ne','cn']}}, 
  
                      ],
                      pager: '#pager',
                      rowNum: 5,
                      rowList:[5,20,30],
                      sortname: 'id',
                      sortorder: 'desc',
                      viewrecords: true,
                      height: 'auto',
                      width: 725, 
  
                      shrinkToFit: false,
                      gridview: true,
                      caption: 'Members',
                      editurl:"update.php"
  
                  });
                  jQuery("#list1").jqGrid('navGrid','#pager',{edit:true,add:true,del:true});
  
              });
  
          &lt;/script&gt;  
  </code></pre>
  
  <p>In Editurl page ie update.php file I write the following code to do add,edit,delete a row.</p>
  
  <pre><code>mysql_connect($dbserver, $dbuser, $dbpassword);
  mysql_select_db($dbname);
  $sno = $_POST['sno'];
  $occ = $_POST['occasion'];
  $gr = $_POST['greeting'];
  if ($_POST['oper'] == 'add') {
      $q = mysql_query("insert into t1 values('$sno','$occ','$gr')") or die(mysql_error());
  }
  if ($_POST['oper'] == 'edit') {
      $q = mysql_query("update t1 set sno='$sno',occasion='$occ',greeting='$gr' where sno='$sno'")or die(mysql_error());
  }
  if ($_POST['oper'] == 'del') {
  
      $q = mysql_query("delete from t1 where rowid='$_POST[id]'")or die(mysql_error());
  }
  </code></pre>
  
  <p>All add and edit functionality are working , Delete query only not working . First I tried like </p>
  
  <pre><code>$q = mysql_query("delete from t1 where sno='$sno'")or die(mysql_error());
  </code></pre>
  
  <p>That Query is not working and I got error like sno,occasion,greetings are undefined.
  Because post attributes are oper,id only .
  And I dont know how to delete a row using that id.</p>
  
  <p>Plz provide me correct method</p>