title: save data in editable dynamic html table
body: <p>I have created editable dynamic html table, on double click over a text the user is able to change it but the change is temporary, i wish to save it in database also.</p>
  
  <p>My code for table is (<a href="http://jsfiddle.net/learner001/rzmnqfqa/" rel="nofollow">@jsfiddle</a>)</p>
  
  <p>html table</p>
  
  <pre><code>&lt;table class="editableTable table table-striped table-bordered"&gt;
  &lt;thead&gt;
      &lt;tr&gt;
          &lt;th&gt; A &lt;/th&gt;
          &lt;th&gt; B &lt;/th&gt;
          &lt;th&gt; C &lt;/th&gt;
          &lt;th&gt; D &lt;/th&gt;
      &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
  
      &lt;?php
      $sql=" SELECT * from orderid";
      $result = mysqli_query($con, $sql);
      if(mysqli_num_rows($result)&gt;0)
          {
              while($row = mysqli_fetch_assoc($result))
                  {?&gt; &lt;tr&gt;
                          &lt;td&gt; &lt;? echo $row['a']; ?&gt; &lt;/td&gt;
                          &lt;td&gt; &lt;? echo $row['b']; ?&gt; &lt;/td&gt;
                          &lt;td&gt; &lt;? echo $row['c']; ?&gt; &lt;/td&gt;
                          &lt;td&gt; &lt;? echo $row['d']; ?&gt; &lt;/td&gt;
                      &lt;/tr&gt;   
                  &lt;?}
          }?&gt;
  
  &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>script code</p>
  
  <pre><code> $(function () 
          { 
              $("td").dblclick(function () 
                  { 
                      var OriginalContent = $(this).text(); 
                      $(this).addClass("cellEditing"); 
                      $(this).html("&lt;input type='text' value='" + OriginalContent + "' /&gt;"); 
                      $(this).children().first().focus(); 
                      $(this).children().first().keypress(function (e) 
                          {
                              if (e.which == 13)
                                  {   
                                      var newContent = $(this).val(); 
                                      $(this).parent().text(newContent); 
                                      $(this).parent().removeClass("cellEditing"); 
                                  } 
                          }); 
                      $(this).children().first().blur(function()
                          {
                              $(this).parent().text(OriginalContent); 
                              $(this).parent().removeClass("cellEditing"); 
                          }); 
                  }); 
          });
  </code></pre>
  
  <p>code i wish to use to edit the entry is</p>
  
  <pre><code>$sql1="UPDATE tablename set A='".$a."', B= '".$b."', C= '".$c."', D= '".$d."' WHERE id='".$id."' ";
  if(!mysqli_query($con,$sql1))
      {
          die('Error:' . mysqli_error($con));
      }
  </code></pre>
  
  <p>table view</p>
  
  <pre><code>id  A  B  C  D
  1   a  b  c  d
  </code></pre>
  
  <p>Can anyone please tell me how i can save the new entry in database</p>