게시글수 n개 이상인 회원을 출력하고 싶은데
안되네요 ㅠㅠㅠ
어떻게 해야되나요?ㅠ
Copy
<?$sql_common = " from {$g5['member_table']} ";$sql_search = " where (1) ";$sst = "mb_datetime";$sod = "desc";$sql_order = " order by {$sst} {$sod} ";$rows = $config['cf_page_rows'];$sql = " select * {$sql_common} {$sql_search} {$sql_order} limit {$from_record}, {$rows} ";$result = sql_query($sql);?> <?php for ($i=0; $row=sql_fetch_array($result); $i++) { $sql22 = " SELECT sum(if(wr_id=wr_parent,1,0)) as write_count, sum(if(wr_id<>wr_parent,1,0)) as comment_count FROM `g5_board_new` WHERE mb_id='{$row['mb_id']}' "; $row22 = sql_fetch($sql22); echo number_format($row22[write_count]); echo number_format($row22[comment_count]); echo $row['mb_id']; } ?>
이렇게 하면 자기 게시글수를 출력은 하는데...
n개 이상인 사람만 출력하려는데...
안되네요 ㅠㅠ
|
답변 2개 / 댓글 1개
채택된 답변
+20 포인트
불량학생™
2017-07-26 (수) 15:13:16
쿼리에서 하고 싶다면 $sql22 이곳에서 where 구문에 추가하시면 되지 않나요?
불량학생™
2017-07-26 (수) 14:01:28
if($row22[write_count] > 원하는개수) {
echo "룰루랄라";
}
이게 안된다는 건가요?
답변에 대한 댓글 1개
답변을 작성하려면 로그인이 필요합니다.