-2
데이터베이스에서 데이터를 가져 와서 PHP의 jquery를 사용하여 html 테이블에 바인딩하려고합니다. 결과가 올바르게 표시됩니다. 하지만 나는 가져온 데이터를 편집 할 수 있어야한다는 의미로 내부 텍스트 상자에 데이터를 가져 오려고합니다. 제 요구를하십시오.데이터베이스에서 데이터를 가져와 PHP에서 jquery를 사용하여 html 테이블에 바인딩
내 코드는입니다.
이<table class="table table-striped table-hover metable table-bordered" id="editable-sample">
<thead>
<tr>
<th>Id</th>
<th>Customer Id</th>
<th>Item Number</th>
<th>Quantity</th>
</tr>
</thead>
<tbody>
<?php
foreach ($tempresults as $result)
{
?>
<tr class="">
<td><input type="text" name="order_id" id="order_id" value="<?php echo $result->order_id;?>"></td>
<td><input type="text" name="customer_id" id="customer_id" value="<?php echo $result->customer_id;?>"></td>
<td><input type="text" name="item_id" id="item_id" value="<?php echo $result->item_id;?>"></td>
<td><input type="text" name="count" id="count" value="<?php echo $result->count;?>"></td>
</tr>
<?php
}
?>
</tbody>
</table>
Thanks,
는 $ ("#의 ORDER_ID")'을 수행하여 텍스트 필드의 각각의 값을 설정 발 (result.correspondingdata가). '(당신의 데이터를 반환한다고 가정 정렬). –