Files
firstgarden-web-gnu/adm/shop_admin/item_option_check.php
2013-01-25 11:48:46 +09:00

36 lines
1.0 KiB
PHP

<?php
include_once('./_common.php');
// 선택/추가 옵션 테이블에서 상품정보가 없는 정보 삭제
$sql = " select distinct it_id
from {$g4['yc4_option_table']}
order by opt_id ";
$result = sql_query($sql);
for($i=0; $row=sql_fetch_array($result); $i++) {
// 상품정보 체크
$sql1 = " select it_id from {$g4['yc4_item_table']} where it_id = '{$row['it_id']}' ";
$row1 = sql_fetch($sql1);
if(!$row1['it_id']) {
@sql_query(" delete from {$g4['yc4_option_table']} where it_id = '{$row['it_id']}' ");
}
}
$sql = " select distinct it_id
from {$g4['yc4_supplement_table']}
order by sp_id ";
$result = sql_query($sql);
for($i=0; $row=sql_fetch_array($result); $i++) {
// 상품정보 체크
$sql1 = " select it_id from {$g4['yc4_item_table']} where it_id = '{$row['it_id']}' ";
$row1 = sql_fetch($sql1);
if(!$row1['it_id']) {
@sql_query(" delete from {$g4['yc4_supplement_table']} where it_id = '{$row['it_id']}' ");
}
}
?>