채택완료

wr_1의 값이 1인 게시물만 호출하려면 어떻게해야 될까요?

2016-03-29 (화) 10:01:30 3,550

아래는 특정 게시판의 게시물 갯수를 호출하는 소스입니다.

여기에 추가로 특정 게시판의 wr_1의 값이 1인 게시물만 호출하려면 어떻게해야 될까요?

도움 부탁 드립니다~

<?php

function board_count($bo_table) {

$row = sql_fetch(" select bo_count_write from g5_board where bo_table = '".$bo_table."' ");

    return $row['bo_count_write'];

}

?>

|

답변 2개

채택된 답변
+20 포인트

select count(*) cnt  from g5_write_{$bo_table} where wr_1='1'

return $row['cnt']; 

2016-03-29 (화) 10:06:22

where bo_table = '".$bo_table."' and wr_1 = '1' 

답변을 작성하려면 로그인이 필요합니다.