Inline editable row to update each records in database mysql using ajax php
<p>this question is relevant to <a href="https://stackoverflow.com/questions/39565300/error-in-ajax-insert-database/39565683">Error in ajax insert database</a>. Many advices, but none of them helps.
You can see a demo: <a href="http://phppot.com/php/php-mysql-inline-editing-using-jquery-ajax/" rel="nofollow noreferrer">http://phppot.com/php/php-mysql-inline-editing-using-jquery-ajax/</a>
I have trouble in using ajax, PHP and mysql to edit records in database. 
The table <code>dsdonhang</code> has many records, each record performs a order. I want the last column to show a string (tracking shipping), called <code>mavandon</code>, and it can be edited inline, with <code>onBlur</code> trigger.
The ajax function send data with 2 parameters:</p>

<ol>
<li><p>$idd: the row to edit</p></li>
<li><p>text: value to update</p></li>
</ol>

<p>index.php:</p>

<pre><code>&lt;?php
$query = mysqli_query($conn,"SELECT * FROM dsdonhang");            
while($row=mysqli_fetch_assoc($query)) {
    $data[] = $row;
}
foreach($data as $k=&gt;$v) {
?&gt;
&lt;tr&gt;
&lt;td&gt;&lt;?php $madon = $data[$k]["idd"];echo $k+1; ?&gt;&lt;/td&gt;    
&lt;td&gt;&lt;?php echo $data[$k]["donhang"]; ?&gt;&lt;/td&gt;        
&lt;td contenteditable="true" onBlur="SOMETHING..."&gt;&lt;?php echo $data[$k]["mavandon"]; ?&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;?php            
}
?&gt;
</code></pre>

<p>Structure of table <code>dsdonhang</code>:</p>

<p>idd int(11) PRIMARY NOT NULL</p>

<p>donhang varchar(50) NOT NULL</p>

<p>mavandon varchar(12) NOT NULL</p>

<p>If you have any idea or suggestion, please guide me. It will help me a lot. Thanks!</p>