거참이건왜안되는건지,,, > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

거참이건왜안되는건지,,, 정보

거참이건왜안되는건지,,,

본문

나라오름님 클럽 카타고리를 이런식으로 나오게 했습니다,
아이프래임으로 불러드리면 잘나오는데,,
<? include_once("$g4[path]/club/include/cb_new2.inc.php"); ?>
이런방식으로 불러드리면,, 안나오는군요,,
뭐를 잘못만든거지^^
애혀`~
초보는 만들기만하면오류가 나니 !!
 
 
<?
// 클럽 카테고리
$sql    = " select a.*, count(b.cb_id) as total
              from $nc[tbl_category] as a
        left join $nc[tbl_club] as b
                on a.cc_id = b.cc_id
          group by a.cc_id
          order by a.cc_idx asc ";
$result = mysql_query($sql);
?>  <table width="100%" border="0" cellspacing="1" bgcolor="#FFFFFF">
        <tr>
          <td bgcolor="#EEEEEE" style="padding:7px 10px 5px 5px"><strong>클럽
            카테고리</strong></td>
        </tr>
        <tr>
          <td height="3"></td>
        </tr>
        <?
        for ($i=0; $row=mysql_fetch_array($result); $i++) {
            if ($i && ($i%1==0)) {
                echo "</tr><tr>";
            }
        ?>
          <td style="padding:3px 10px 2px 10px"><a href="./club_index.php?doc=<?=rawurlencode("cb_list.php?cc_id={$row[cc_id]}")?>" target='_top'><?=$row[cc_name]?></a> <span class="tahoma10">(<?=$row[total]?>)</span></td>
        <? } ?>
      </table>

댓글 전체

이파일을 인클루드한 파일에서 이미 같은 변수를 사용하기 때문에
변수 충돌로 인하여 안나올 가능성이 있으므로 변경을 시도해 보세요.

<?
// 클럽 카테고리
$sqlc = " select a.*, count(b.cb_id) as total
              from $nc[tbl_category] as a
        left join $nc[tbl_club] as b
                on a.cc_id = b.cc_id
          group by a.cc_id
          order by a.cc_idx asc ";
$resultc = mysql_query($sqlc);
?>  <table width="100%" border="0" cellspacing="1" bgcolor="#FFFFFF">
        <tr>
          <td bgcolor="#EEEEEE" style="padding:7px 10px 5px 5px"><strong>클럽
            카테고리</strong></td>
        </tr>
        <tr>
          <td height="3"></td>
        </tr>
        <?
        for ($ic=0; $rowc=mysql_fetch_array($resultc); $ic++) {
            if ($ic && ($ic%1==0)) {
                echo "</tr><tr>";
            }
        ?>
          <td style="padding:3px 10px 2px 10px"><a href="./club_index.php?doc=<?=rawurlencode("cb_list.php?cc_id={$rowc[cc_id]}")?>" target='_top'><?=$rowc[cc_name]?></a> <span class="tahoma10">(<?=$rowc[total]?>)</span></td>
        <? } ?>
      </table>
<?
// &Aring;&not;·´ &Auml;&laquo;&Aring;×°&iacute;¸?
$sql    = " select a.*, count(b.cb_id) as total
              from $nc[tbl_category] as a
        left join $nc[tbl_club] as b
                on a.cc_id = b.cc_id
          group by a.cc_id
          order by a.cc_idx asc ";
$result = mysql_query($sql);
?>
<table width="100%"  border="0" cellspacing="0" cellpadding="1">
  <tr>
    <td bgcolor="#CCCCCC"><table width="100%" border="0" cellspacing="1" bgcolor="#FFFFFF">
        <tr>
          <td bgcolor="#FFFFFF" style="padding:7px 10px 5px 5px"><img src="/main<?=$g4[club_path]?>/member_new/title3.gif" width="140" height="21"></td>
        </tr>
        <tr>
          <td height="3"></td>
        </tr>
        <?
        for ($i=0; $row=mysql_fetch_array($result); $i++) {
            if ($i && ($i%1==0)) {
                echo "</tr><tr>";
            }
        ?>
          <td style="padding:3px 10px 2px 10px"><a href="./club_index.php?doc=<?=rawurlencode("cb_list.php?cc_id={$row[cc_id]}")?>" target='_top'><b><?=$row[cc_name]?></b></a> <span class="tahoma10">(<b><?=$row[total]?></b>)</span></td>
        <? } ?>
      </table></td>
  </tr>
</table>
이게다인데요?
위의소스를 아이프렘으로 불러들일 경우 클럽 카데고리가 나올수가 없습니다.
뭔가 빠진부분이 있는듯 합니다. 위소스대로 라면 DB접속은 어떻게 하며 클럽
관련 테이블 필드명과 쿼리부분의 변수는 어디서 가져오죠?
쪽지 신공으로 확인해본 바로는 에러의 문제는 다음과 같습니다.

클럽용 환경설정 파일과 사이트용 환경설정 파일을 서로 다른걸 가져오기 때문에
클럽에서 사용할 상수?로 선언된 테이블명을 못가져 오는 현상 입니다.
해결방법은 원글의 소스에서 $nc[tbl_category] , $nc[tbl_club] 이라는 테이블명을
실제 이름으로 바꾸거나 사이트 환경설정용 파일에서 추가 해야 합니다.아래
$nc['tbl_category'] = "nc_category";
$nc['tbl_club'] = "nc_club";
전체 66,554 |RSS
그누4 질문답변 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT