정보가 없습니다 문구 출력 할려고 하는데 어떻게 해야할까요??
본문
최근 본 제품 페이지를 개발중에 있는데 최근 본 제품이 없다면 없습니다라는 문구를 넣고 싶은데
어떻게 해야할까요??
<?php
include_once('./_common.php');
include_once(G5_THEME_PATH.'/head.php');
include_once(G5_LIB_PATH.'/thumbnail.lib.php');
$query = "DELETE FROM a_view WHERE rdate < ( CURDATE() + INTERVAL -7 DAY) ";
sql_query($query);
$sql_common = " from a_view a";
$sql_search = " where mb_id = '".$member['mb_id']."'";
$sql_order = " order by rdate desc ";
$sql = " select count(*) as cnt {$sql_common} {$sql_search} {$sql_order} ";
$row = sql_fetch($sql);
$total_count = $row['cnt'];
$rows = 10;
$total_page = ceil($total_count / $rows);
if ($page < 1) { $page = 1; }
$from_record = ($page - 1) * $rows;
$sql = " select * {$sql_common} {$sql_search} {$sql_order} limit {$from_record}, {$rows} ";
$result = sql_query($sql);
?>
<link rel="stylesheet" type="text/css" href="/bbs/css/boxtodayview.css?ver=<?php echo G5_CSS_VER; ?>">
<div class="bon_head">
<span class="bon_head_span"><a href="javascript:history.back();"><img src="/bbs/img/new_back_w.png" class="bon_head_img" alt="뒤로가기"></a></span>
<p class="bon_head_p">최근 본 상품</p>
</div>
<div class="bon_content">
<?php
for ($i=0; $row=sql_fetch_array($result); $i++) {
?>
<div class="box_box_bon">
<a href="/bbs/board.php?bo_table=<?php echo $row['bo_table']?>&wr_id=<?php echo $row['goodsNo']?>">
<div class="c-box_img">
<?php
$thumb = get_list_thumbnail($row['bo_table'], $row['goodsNo'], 600, 500, false, true);
if($thumb['src']) {
$img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" >';
} else {
$img_content = '<span class="no_image">no image</span>';
}
echo $img_content;
?>
</div>
<div class="c_box_tit">
<p class="shop_bon_gp_tit1"><?php echo $row['brandle'] ?></p>
<p class="shop_bon_gp_tit"><?php echo $row['title'] ?></p>
</div>
</a>
</div>
<?php } ?>
</div>
코드첨부 하겠습니다.
!-->답변 1
<?php if( $total_count
> 0)for ($i=0; $row=sql_fetch_array($result); $i++) { ?> <div class="box_box_bon">
...
</div> <?php } else echo '
정보가 없습니다';?> </div>
답변을 작성하시기 전에 로그인 해주세요.