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"으로 바꾸어 사용중인데도 잘 안되서 질문 드립니다.

답변 부탁 드립니다.
|

댓글 2개

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>
댓글을 작성하시려면 로그인이 필요합니다. 로그인

그누3질답

+
제목 글쓴이 날짜 조회
22년 전 조회 1,196
22년 전 조회 878
22년 전 조회 835
22년 전 조회 980
22년 전 조회 785
22년 전 조회 917
22년 전 조회 757
22년 전 조회 1,006
22년 전 조회 826
22년 전 조회 1,013
22년 전 조회 1,059
22년 전 조회 782
22년 전 조회 845
22년 전 조회 868
22년 전 조회 887
22년 전 조회 1,307
22년 전 조회 964
22년 전 조회 842
22년 전 조회 858
22년 전 조회 898
🐛 버그신고