日期:2014-05-17 浏览次数:20613 次
$a = array (
0 =>
array (
'cust_no' => '310F6 1VA5A',
'lotno' => '2X15',
'count' => '0',
),
1 =>
array (
'cust_no' => '310F6 1VA5A',
'lotno' => '2Z15',
'count' => '16',
),
);
$b = array (
0 =>
array (
'cust_no' => '310F6 1VA5A',
'lotno' => '2X15',
'count' => '0',
),
1 =>
array (
'cust_no' => '310F6 1VA5A',
'lotno' => '2Z15',
'count' => '32',
),
2 =>
array (
'cust_no' => '310F6 1VA5A',
'lotno' => '3528',
'count' => '80',
),
);
foreach($b as $i=>$v) {
print_r($v);
if(isset($a[$i]) && $v['cust_no'] == $a[$i]['cust_no'] && $v['lotno'] == $a[$i]['lotno']) {
echo "update table sql\n";
}else echo "insert table sql\n";
}