From 023f27c320f3272836eafc3b7f3622fdbc797704 Mon Sep 17 00:00:00 2001 From: thisgun Date: Tue, 13 Jun 2017 19:31:34 +0900 Subject: [PATCH] =?UTF-8?q?=EC=98=81=EC=B9=B4=ED=8A=B8=20sql=20=EC=9D=B8?= =?UTF-8?q?=EC=A0=9D=EC=85=98=20=EC=B7=A8=EC=95=BD=EC=A0=90=2017-292=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shop/orderaddressupdate.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/shop/orderaddressupdate.php b/shop/orderaddressupdate.php index 6211f4864..083cb8160 100644 --- a/shop/orderaddressupdate.php +++ b/shop/orderaddressupdate.php @@ -14,20 +14,21 @@ if ($is_member && $count) { for ($i=0; $i<$count; $i++) { // 실제 번호를 넘김 - $k = $_POST['chk'][$i]; + $k = (int) $_POST['chk'][$i]; + $ad_id = (int) $_POST['ad_id'][$k]; $ad_subject = clean_xss_tags($_POST['ad_subject'][$k]); $sql = " update {$g5['g5_shop_order_address_table']} set ad_subject = '$ad_subject' "; - if($_POST['ad_default'] && $_POST['ad_id'][$k] == $_POST['ad_default']) { + if(!empty($_POST['ad_default']) && $ad_id == $_POST['ad_default']) { sql_query(" update {$g5['g5_shop_order_address_table']} set ad_default = '0' where mb_id = '{$member['mb_id']}' "); $sql .= ", ad_default = '1' "; } - $sql .= " where ad_id = '{$_POST['ad_id'][$k]}' + $sql .= " where ad_id = '".$ad_id."' and mb_id = '{$member['mb_id']}' "; sql_query($sql);