답변 1개 / 댓글 4개
채택된 답변
+20 포인트
이런식으로 해도 될꺼 같은데요
Copy
<?php
// 추천된 게시물 가져오기 (wr_6에 추천이 입력된 글)
$sql = " select * from {$write_table}
where wr_6 != ''
and wr_is_comment = 0
order by wr_datetime desc
limit 0, 5 "; // 최근 5개만 출력
$result = sql_query($sql);
?>
<!-- 추천글 목록 출력 -->
<?php if(sql_num_rows($result) > 0) { ?>
<div class="recommended-posts">
<h2>추천 게시물</h2>
<ul>
<?php
while ($row = sql_fetch_array($result)) {
$subject = conv_subject($row['wr_subject'], 40); ?>
<?php echo $subject ?>
<?php
}
} ?>
답변에 대한 댓글 4개
답변을 작성하려면 로그인이 필요합니다.