get data from database and bind to html table using jquery in php
<p>Am trying to get the data from database and bind to html table using jquery in php. results showing correctly. but i want to fetch the data into inside text box which means the fetched data should be editable. please do my needs.</p>

<p>my code is.</p>

<pre><code>$.ajax({

           type: "POST",
          url: "add_temp_purchase",
         cache: false,
         data: 'itemnum='+itemnum+'&amp;quantity='+quantity+'&amp;customer_id='+customer_id,
         dataType: "html",
         success: function(returnhtml) {
             //alert(customer_id);
               $.ajax({

                type: "GET",
                url: "gettempid",
                cache: false,
               data: 'customer_id='+customer_id,
               dataType: "html",
              beforeSend: function() {
                                                                                    $('#metable').html('loading please wait...');
                                                                                             },
                         success: function(htmldata) {
                 var order_id = order_id;
                  var customer_id = customer_id;
                  var item_id = itemnum;
                  var count = quantity;

                 alert(customer_id);


                 $(".metable").find('tbody').append('&lt;tr&gt;&lt;td&gt;' + order_id +
                '&lt;/td&gt;&lt;td&gt;&lt;input type="text"&gt;' + customer_id +
                      '&lt;/td&gt;&lt;td&gt;&lt;input type="text"&gt;' + item_id +
                '&lt;/td&gt;&lt;td&gt;&lt;input type="text"&gt;' + count +
                    '&lt;/td&gt;&lt;/tr&gt;');


                        }
                       });  
</code></pre>

<p>My html code is:</p>

<pre><code>&lt;table class="table table-striped table-hover metable table-bordered" id="editable-sample"&gt;
                              &lt;thead&gt;
                              &lt;tr&gt;
                    &lt;th&gt;Id&lt;/th&gt;
                                  &lt;th&gt;Customer Id&lt;/th&gt;
                                  &lt;th&gt;Item Number&lt;/th&gt;
                                  &lt;th&gt;Quantity&lt;/th&gt;

                              &lt;/tr&gt;
                              &lt;/thead&gt;
                              &lt;tbody&gt;
                              &lt;?php
         foreach ($tempresults as $result)
               {
               ?&gt;
                              &lt;tr class=""&gt;
            &lt;td&gt;&lt;input type="text" name="order_id" id="order_id" value="&lt;?php echo $result-&gt;order_id;?&gt;"&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type="text" name="customer_id" id="customer_id" value="&lt;?php echo $result-&gt;customer_id;?&gt;"&gt;&lt;/td&gt;
           &lt;td&gt;&lt;input type="text" name="item_id" id="item_id" value="&lt;?php echo $result-&gt;item_id;?&gt;"&gt;&lt;/td&gt;
         &lt;td&gt;&lt;input type="text" name="count" id="count" value="&lt;?php echo $result-&gt;count;?&gt;"&gt;&lt;/td&gt;

                              &lt;/tr&gt;

                               &lt;?php
          }
                   ?&gt;
                              &lt;/tbody&gt;
                          &lt;/table&gt;
                                                                Thanks,
</code></pre>