탈

게시판을 통합해서 자료를 뽑고 싶을 때는

이것 저것 짜맞추어서 대충은 만들었는데,
for 문을 사용함으로 인해서 각각의 게시판 별로 나오게 되어 글쓴 사람의 종합적인 글쓴수를 알려면 계산기를 들고 덧셈을 해야 하게 됐습니다.

아래와 같은 결과값을 모든 게시판을 통합해서 추출하려면 어떻게 해야 하는지 아시는 분은 좀 알려주세요.

// 최신글 시작
$sql = " select bo_table, bo_subject from $cfg[table_board] where bo_table <> 'sk08' and bo_table <> 'sk13_1' order by gr_id, bo_table ";
$result = sql_query($sql);
for ($i=0; $row=mysql_fetch_array($result); $i++) {
$su = "gb_write";
$su2 = $su."_".$row[bo_table];
$sql2 = " select distinct(wr_name) from $su2 order by wr_name";
$result2 = sql_query($sql2);

echo " <br> <table width=100% height=5><tr><td bgcolor=beige>$row[bo_subject]게시판 신규글</td></tr></table>";
for ($i=0; $row2=mysql_fetch_array($result2); $i++) {

$sql3 = " select COUNT(wr_name) from $su2 where wr_name = '$row2[wr_name]' and wr_parent_id >'0' and wr_comment ='0'";
$result3 = sql_query($sql3);
$row3 = mysql_fetch_array($result3);
$total_count = $row3[0];
mysql_free_result($result3);
if ($total_count > 0) {
echo "<table><tr><td>";
echo " - $row2[wr_name]님 ($total_count 건)";
echo "</td></tr></table>"; } }}
댓글을 작성하시려면 로그인이 필요합니다.

그누3질답

9,564건
+
제목 글쓴이 날짜 조회
04-01-06 조회 579
04-01-06 조회 824
04-01-05 조회 533
04-01-05 조회 738
04-01-05 조회 697
04-01-06 조회 387
04-01-05 조회 516
04-01-05 조회 388
04-01-05 조회 452
04-01-05 조회 554
04-01-05 조회 455
04-01-04 조회 517
04-01-04 조회 391
04-01-04 조회 686
04-01-04 조회 671
04-01-04 조회 657
MMando
04-01-04 조회 737
MMando
04-01-04 조회 601
04-01-04 조회 581
04-01-04 조회 645