등록된 내용이 없을때 메세지 등록된게 없다는 메세지 출력

<?
$list_mod = $default[de_rel_list_mod];
$img_width = $default[de_rel_img_width];
$img_height = $default[de_rel_img_height];
$td_width = (int)(100 / $list_mod);

$sql = " select b.*
from $g4[yc4_item_relation_table] a
left join $g4[yc4_item_table] b on (a.it_id2=b.it_id)
where a.it_id = '$it[it_id]'
and b.it_use='1' ";
$result = sql_query($sql);
$num = @mysql_num_rows($result);
if ($num)
include "$g4[shop_path]/maintype21.inc.php";
else
echo "<div id='it_relation'><? display_type(1, 'maintype21.inc.php', 3, 1, 120, 120); ?>";echo "</div>";

echo "<div id='it_relation_no'>이 상품과 관련된 상품이 없습니다.</div>";

?>

등록된 상품이 있을때 <div id='it_relation'>관련상품</div>가오고
등록된 상품이 없을때는<div id='it_relation_no'>등록된 상품이 없지롱</div>가 나오게 하고싶은데요.

생각처럼 않되네요.
어떻게 해야 할까요.
도움좀 부탁합니다.

|

댓글 1개

if ($num) {
include "$g4[shop_path]/maintype21.inc.php"; // 필요없으면 주석처리하심 됩니다~
?>

<div id='it_relation'><?=display_type(1, 'maintype21.inc.php', 3, 1, 120, 120); ?></div>

<? } else { ?>
<div id='it_relation_no'>이 상품과 관련된 상품이 없습니다.</div>
<? } ?>
댓글을 작성하시려면 로그인이 필요합니다. 로그인

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
12년 전 조회 2,311
12년 전 조회 1,638
12년 전 조회 1,653
12년 전 조회 1,660
12년 전 조회 1,292
12년 전 조회 1,099
12년 전 조회 2,059
12년 전 조회 1,987
12년 전 조회 1,604
12년 전 조회 1,635
12년 전 조회 1,638
12년 전 조회 1,268
12년 전 조회 1,602
12년 전 조회 6,613
12년 전 조회 1,103
12년 전 조회 2,508
12년 전 조회 1,625
12년 전 조회 1,033
12년 전 조회 1,301
12년 전 조회 1,589
🐛 버그신고