|
|
|
ติดError insert Check box พร้อมกับ text อ่ะครับ [ช่วยผมหน่อยเถอะ _//\\_] |
|
|
|
|
|
|
|
Code (PHP)
<input align="center" type="checkbox" name="checkGE[]" value="<?=$objResult["ID_Material"];?>">
//และ
<input type="text" name="Quantity[]" id="Quantity" value="" />
|
|
|
|
|
Date :
2013-06-25 00:31:44 |
By :
Krungsri |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
แนวทางการทำงานนะครับ เอาไปประยุกต์ดู
Form (PHP)
<form method="post" action="action.php">
<table width="800" border="1">
<tr>
<td>Order</td>
<td>Name</td>
<td>Code</td>
<td>Quantity</td>
<td>Type</td>
<td>Class</td>
<td>Add</td>
</tr>
<? for($i=1;$i<=5;$i++){?>
<tr>
<td><?=$i?></td>
<td>Name Material <?=$i?></td>
<td>Code</td>
<td><input type="text" name="Qa[<?=$i?>]"></td>
<td>RM</td>
<td>2nd</td>
<td><input type="checkbox" name="Chkb[<?=$i?>]" value="<?=$i?>"></td>
</tr>
<? }?>
</table>
<input type="submit" value="Submit">
</form>
action.php
<?
$Qa = $_POST['Qa'];
$Chkb = $_POST['Chkb'];
echo '<pre>';
print_r($Qa);
print_r($Chkb);
echo '</pre>';
foreach($Chkb as $k=>$v){
$f1 = $Qa[$v];
$sql = "INSERT INTO Table(F1) VALUES('$f1')";
echo $sql."<br>";
}
?>
|
|
|
|
|
Date :
2013-06-25 01:47:03 |
By :
Krungsri |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 04
|