Foreach 适用于单个数组,但不适用于两个数组.. 但它需要两个数组,这可能吗?
示例:foreach($okeymi 作为 $tokeymi和 $sipno 作为 $tsipno )
<input type='checkbox' name='okeymi[]' value='okey'/>
<input type='checkbox' name='okeymi[]' value='okey'/>
<input type='checkbox' name='okeymi[]' value='okey'/>
<input type='checkbox' name='okeymi[]' value='okey'/>
<input type='text' name='sipno[]' value='1080'/>
<input type='text' name='sipno[]' value='8408'/>
<input type='text' name='sipno[]' value='1515'/>
<input type='text' name='sipno[]' value='9098'/>
$okeymi = $_POST['okeymi'];
$sipno = $_POST['sipno'];
foreach($okeymi as $tokeymi and $sipno as $tsipno) {
$objConnect = mssql_connect("xxx","xxx","xxx") or die("Error Connect to Database");
$objDB = mssql_select_db("xxxx");
$ftrSQL = "UPDATE [xxxx].[dbo].xxxx SET BAKIYEDEMI='okey' where STOK_KODU='$tokeymi' AND SIPARIS_NO='$tsipno'";
$hbjQuery = mssql_query($ftrSQL);
}