请问一下代码如何修改能影响多行数据,谢谢
$goods_num=pdo_fetchcolumn('SELECTgoods_numFROM'.tablename('wc_order_stat')."WHEREuni...
$goods_num = pdo_fetchcolumn('SELECT goods_num FROM ' . tablename('wc_order_stat') . " WHERE uniacid = :aid AND oid = :oid", array(':aid' => $_W['uniacid'], ':oid' => $id));
$goods_id = pdo_fetchcolumn('SELECT goods_id FROM ' . tablename('wc_order_stat') . " WHERE uniacid = :aid AND oid = :oid", array(':aid' => $_W['uniacid'], ':oid' => $id));
$total = pdo_fetchcolumn('SELECT total FROM ' . tablename('wc_goods') . " WHERE uniacid = :aid AND id = :id", array(':aid' => $_W['uniacid'], ':id' => $goods_id));
$goods_bnum = $total + $goods_num;
if ($total > -1){
pdo_update('wc_goods', array('total' => $goods_bnum), array('uniacid' => $_W['uniacid'], 'id' => $goods_id));
} 展开
$goods_id = pdo_fetchcolumn('SELECT goods_id FROM ' . tablename('wc_order_stat') . " WHERE uniacid = :aid AND oid = :oid", array(':aid' => $_W['uniacid'], ':oid' => $id));
$total = pdo_fetchcolumn('SELECT total FROM ' . tablename('wc_goods') . " WHERE uniacid = :aid AND id = :id", array(':aid' => $_W['uniacid'], ':id' => $goods_id));
$goods_bnum = $total + $goods_num;
if ($total > -1){
pdo_update('wc_goods', array('total' => $goods_bnum), array('uniacid' => $_W['uniacid'], 'id' => $goods_id));
} 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询