2.60 최신글 추출시 테이블명 지정에 대한 질문입니다. > 그누3질답

그누3질답

2.60 최신글 추출시 테이블명 지정에 대한 질문입니다. 정보

그누보드 2.60 최신글 추출시 테이블명 지정에 대한 질문입니다.

본문

안녕하세요!

현재 index.htm 파일을 아래와 같이 사용 중입니다.

-----------------------------------------
<?
include_once "lib.inc.php";

echo head("그누보드");
?>

 &nbsp; &nbsp; &nbsp; &nbsp;<!-- 최신글 시작 -->
 &nbsp; &nbsp; &nbsp; &nbsp;<?
 &nbsp; &nbsp; &nbsp; &nbsp;$sql = " select * from $cfg[table_board] order by gr_id, bo_table ";
 &nbsp; &nbsp; &nbsp; &nbsp;$result = sql_query_error($sql);
 &nbsp; &nbsp; &nbsp; &nbsp;for ($i=0; $row=mysql_fetch_array($result); $i++) {
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;echo "<table width=100% border=0 cellpadding=1 cellspacing=0 class=tablebg>";
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;echo "<tr><td height=25>&nbsp; <a href='$reldir/$bbsdir/gnuboard.php?bo_table=notice'><b><font color=ffffff>$row[bo_subject]</font></b></a></td></tr>";
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;echo "<tr><td>";
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;latest('', index, 5, 35);
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;echo "</td></tr></table><p>";
 &nbsp; &nbsp; &nbsp; &nbsp;}
 &nbsp; &nbsp; &nbsp; &nbsp;?>
 &nbsp; &nbsp; &nbsp; &nbsp;<!-- 최신글 끝 -->

<?
echo tail();
?>
-------------------------------------------------

한개의 그룹에 "notice"과 "test"라는 테이블명으로 두개의 게시판을 생성하여 사용중입니다.

메인화면에는 테이블명이 "notice"인 게시판의 최신글만 추출하려고 하는데 자꾸 "notice"와 "test" 게시판 두개가 메인화면에 뜨더군요. 두 최신글 리스트의 내용은 모두 "notice" 게시판의 내용이더라구요.

소스중 "$row[bo_table]"라고 되있는 두곳을 &nbsp;공지사항 테이블명인 "notice"으로 바꾸어 사용중인데도 잘 안되서 질문 드립니다.

답변 부탁 드립니다.
  • 복사

댓글 전체

아녕하세요.
게시판에 찾아보시면 나와있어요....아래와 같이 하시면 됩니다.

<table width=100% border=0 cellpadding=1 cellspacing=0 style="border-width:1; border-color:999999; border-style:solid;" align=center>
      <tr>
          <td>
              <?
              $sql = " select * from $cfg[table_board] order by bo_table ";
              $bo = sql_fetch_array($sql);
              latest('', 테이블명, 10, 40);
              ?>
          </td>
      </tr>
      </table>
© SIRSOFT
현재 페이지 제일 처음으로