title: Editablegrid mysql binding not updating
body: <p>I am using editablegrid with mysql. It binds and display data to my grid. However when I try to edit or update the grid it fails to do so. </p>
  
  <p>Below is the some of the code of my loaddata,</p>
  
  <pre><code>$grid-&gt;addColumn('CertificateNo', 'CertificateNo', 'integer', NULL, false); 
  $grid-&gt;addColumn('ID', 'ID', 'integer');
  $grid-&gt;addColumn('QuizNo', 'Test No', 'integer');  
  $grid-&gt;addColumn('Received', 'Received', 'boolean');  
  $grid-&gt;addColumn('DateReceived', 'Date Received', 'datetime'); 
  </code></pre>
  
  <p>Below is code for the update script:</p>
  
  <pre><code>    // Get all parameters provided by the javascript
  $colname = $mysqli-&gt;real_escape_string(strip_tags($_POST['colname']));
  $id = $mysqli-&gt;real_escape_string(strip_tags($_POST['id']));
  $coltype = $mysqli-&gt;real_escape_string(strip_tags($_POST['coltype']));
  $value = $mysqli-&gt;real_escape_string(strip_tags($_POST['newvalue']));
  $tablename = $mysqli-&gt;real_escape_string(strip_tags($_POST['tablename']));
      / This very generic. So this script can be used to update several tables.
  $return=false;
  if ( $stmt = $mysqli-&gt;prepare("UPDATE ".$tablename." SET ".$colname." = ? WHERE id = ?")) {
      $stmt-&gt;bind_param("si",$value, $id);
      $return = $stmt-&gt;execute();
      $stmt-&gt;close();
  </code></pre>
  
  <p>Below is the part of javascript which passes the value to my update.php script.</p>
  
  <pre><code>    function updateCellValue(editableGrid, rowIndex, columnIndex, oldValue, newValue, row, onResponse)
  {      
      $.ajax({
          url: 'update.php',
          type: 'POST',
          dataType: "html",
          data: {
              tablename : editableGrid.name,
              id: editableGrid.getRowId(rowIndex), 
              newvalue: editableGrid.getColumnType(columnIndex) == "boolean" ? (newValue ? 1 : 0) : newValue, 
              colname: editableGrid.getColumnName(columnIndex),
              coltype: editableGrid.getColumnType(columnIndex)            
          },
          success: function (response) 
          { 
              // reset old value if failed then highlight row
              var success = onResponse ? onResponse(response) : (response == "ok" || !isNaN(parseInt(response))); // by default, a sucessfull reponse can be "ok" or a database id 
              if (!success) editableGrid.setValueAt(rowIndex, columnIndex, oldValue);
              highlight(row.id, success ? "ok" : "error"); 
          },
          error: function(XMLHttpRequest, textStatus, exception) { alert("Ajax failure\n" + errortext); },
          async: true
      });
  </code></pre>
  
  <p>This template came with a javascript editablegrid-2.0.1. I noticed the problem has to do with primary key. In the demo which can be found from www.editablegrid.net the table has primary key ID whereas mine has CertificateNo but ID in my table is not a primary key.</p>
  
  <p>So I changed the  </p>
  
  <pre><code>$grid-&gt;addColumn('ID', 'ID', 'integer', NULL, false);
  </code></pre>
  
  <p>to</p>
  
  <pre><code>$grid-&gt;addColumn('CertificateNo', 'CertificateNo', 'integer', NULL, false); 
  </code></pre>
  
  <p>Now I can not update the grid. </p>