Here is my full code for my problem and I will explain it:
<form name="form1" action="" method="POST">
<table>
<tr>
<th>ORDER TYPE</th>
<th>ITEM CODE</th>
<th>ITEM NAME</th>
<th>ACTION</th>
</tr>
<?php
$sql = "SELECT * FROM product";
$i = 1; //to generate an unique id and name attr
while($data = mysql_fetch_array($sql)){
$itemcode = $data['cars_kd'];
echo "<tr> <td><select name='select'><option>--Select--</option><option value='0'>Distributor</option><option value='1'>Retail</option>
<input id='id$i' name='name$i' /></select></td>
<td>$data['cars_kd']<input type='hidden' id='id$i' name='name$i' value='$itemcode'/></td>
<td>$data['cars_name']</td>
<td><input type='checkbox' name='check'/><input type='hidden' id='id$i' name='name$i'/></td> </tr> $i++";
}
?>
<input type="submit" name="save" value="Save" />
</table>
In my PHP code above, I use $i to generate an unique id and name attr. After all of the data shown I'll choose some of that data which I want it by checked the checkbox. In my code above I have three input tag. 1. function is to hold the value of the select when checkbox is check. 2. to display $data['cars_kd'] function is to show all of the data record. the value of the input is what I take to then I show well in the third input. 3. function is as parameter of user choice. So, data which I wan to insert is order type (taken from select option value) and item code (taken from input three). I use input because I think I must have a parameter to know what the user choosing.
I hope everyone here can understand my explanation. Hope any suggest :-). Thanks.