지식쇼핑EP 분류명 출력 오류 수정

This commit is contained in:
chicpro
2016-11-16 08:45:50 +09:00
parent daa1fb9fe2
commit 9a275fb530
2 changed files with 19 additions and 13 deletions

View File

@ -45,25 +45,28 @@ $result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
{
$cate1 = $cate2 = $cate3 = $cate4 = "";
$cate1 = $cate2 = $cate3 = $cate4 = '';
$caid1 = $caid2 = $caid3 = $caid4 = '';
$caid1 = substr($row['ca_id'],0,2);
$row2 = sql_fetch(" select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$caid1' ");
$cate1 = $row2['ca_name'];
$cate2 = $cate3 = $cate4 = "";
$cate1 = $row2['ca_name'];
if (strlen($row['ca_id']) >= 8) {
$row2 = sql_fetch(" select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$caid4' ");
$caid4 = substr($row['ca_id'],0,8);
$row2 = sql_fetch(" select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$caid4' ");
$cate4 = $row2['ca_name'];
}
if (strlen($row['ca_id']) >= 6) {
$row2 = sql_fetch(" select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$caid3' ");
$caid3 = substr($row['ca_id'],0,6);
$row2 = sql_fetch(" select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$caid3' ");
$cate3 = $row2['ca_name'];
}
if (strlen($row['ca_id']) >= 4) {
$row2 = sql_fetch(" select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$caid2' ");
$caid2 = substr($row['ca_id'],0,4);
$row2 = sql_fetch(" select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$caid2' ");
$cate2 = $row2['ca_name'];
}

View File

@ -45,25 +45,28 @@ $result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
{
$cate1 = $cate2 = $cate3 = $cate4 = "";
$cate1 = $cate2 = $cate3 = $cate4 = '';
$caid1 = $caid2 = $caid3 = $caid4 = '';
$caid1 = substr($row['ca_id'],0,2);
$row2 = sql_fetch(" select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$caid1' ");
$cate1 = $row2['ca_name'];
$cate2 = $cate3 = $cate4 = "";
if (strlen($row['ca_id']) >= 8) {
$row2 = sql_fetch(" select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$caid4' ");
$caid4 = substr($row['ca_id'],0,8);
$row2 = sql_fetch(" select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$caid4' ");
$cate4 = $row2['ca_name'];
}
if (strlen($row['ca_id']) >= 6) {
$row2 = sql_fetch(" select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$caid3' ");
$caid3 = substr($row['ca_id'],0,6);
$row2 = sql_fetch(" select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$caid3' ");
$cate3 = $row2['ca_name'];
}
if (strlen($row['ca_id']) >= 4) {
$row2 = sql_fetch(" select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$caid2' ");
$caid2 = substr($row['ca_id'],0,4);
$row2 = sql_fetch(" select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$caid2' ");
$cate2 = $row2['ca_name'];
}