2.60 최신글 추출시 테이블명 지정에 대한 질문입니다. 정보
그누보드 2.60 최신글 추출시 테이블명 지정에 대한 질문입니다.본문
안녕하세요!
현재 index.htm 파일을 아래와 같이 사용 중입니다.
-----------------------------------------
<?
include_once "lib.inc.php";
echo head("그누보드");
?>
<!-- 최신글 시작 -->
<?
$sql = " select * from $cfg[table_board] order by gr_id, bo_table ";
$result = sql_query_error($sql);
for ($i=0; $row=mysql_fetch_array($result); $i++) {
echo "<table width=100% border=0 cellpadding=1 cellspacing=0 class=tablebg>";
echo "<tr><td height=25> <a href='$reldir/$bbsdir/gnuboard.php?bo_table=notice'><b><font color=ffffff>$row[bo_subject]</font></b></a></td></tr>";
echo "<tr><td>";
latest('', index, 5, 35);
echo "</td></tr></table><p>";
}
?>
<!-- 최신글 끝 -->
<?
echo tail();
?>
-------------------------------------------------
한개의 그룹에 "notice"과 "test"라는 테이블명으로 두개의 게시판을 생성하여 사용중입니다.
메인화면에는 테이블명이 "notice"인 게시판의 최신글만 추출하려고 하는데 자꾸 "notice"와 "test" 게시판 두개가 메인화면에 뜨더군요. 두 최신글 리스트의 내용은 모두 "notice" 게시판의 내용이더라구요.
소스중 "$row[bo_table]"라고 되있는 두곳을 공지사항 테이블명인 "notice"으로 바꾸어 사용중인데도 잘 안되서 질문 드립니다.
답변 부탁 드립니다.
현재 index.htm 파일을 아래와 같이 사용 중입니다.
-----------------------------------------
<?
include_once "lib.inc.php";
echo head("그누보드");
?>
<!-- 최신글 시작 -->
<?
$sql = " select * from $cfg[table_board] order by gr_id, bo_table ";
$result = sql_query_error($sql);
for ($i=0; $row=mysql_fetch_array($result); $i++) {
echo "<table width=100% border=0 cellpadding=1 cellspacing=0 class=tablebg>";
echo "<tr><td height=25> <a href='$reldir/$bbsdir/gnuboard.php?bo_table=notice'><b><font color=ffffff>$row[bo_subject]</font></b></a></td></tr>";
echo "<tr><td>";
latest('', index, 5, 35);
echo "</td></tr></table><p>";
}
?>
<!-- 최신글 끝 -->
<?
echo tail();
?>
-------------------------------------------------
한개의 그룹에 "notice"과 "test"라는 테이블명으로 두개의 게시판을 생성하여 사용중입니다.
메인화면에는 테이블명이 "notice"인 게시판의 최신글만 추출하려고 하는데 자꾸 "notice"와 "test" 게시판 두개가 메인화면에 뜨더군요. 두 최신글 리스트의 내용은 모두 "notice" 게시판의 내용이더라구요.
소스중 "$row[bo_table]"라고 되있는 두곳을 공지사항 테이블명인 "notice"으로 바꾸어 사용중인데도 잘 안되서 질문 드립니다.
답변 부탁 드립니다.
댓글 전체
life님 감사합니다.
해결되었습니다. ^^
아~ 어려워~
해결되었습니다. ^^
아~ 어려워~
아녕하세요.
게시판에 찾아보시면 나와있어요....아래와 같이 하시면 됩니다.
<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>
게시판에 찾아보시면 나와있어요....아래와 같이 하시면 됩니다.
<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>