게시글을 지정해서 부르려고 합니다. 정보
게시글을 지정해서 부르려고 합니다.본문
그러니까, test라는 게시판에 현재 3개의 글이 있습니다.
그 각 게시물의 주소는 아래와 같습니다.
http://<?$g4[path]?>/g4/board.php?bo_table=test&wr_id=3
http://<?$g4[path]?>/g4/board.php?bo_table=test&wr_id=2
http://<?$g4[path]?>/g4/board.php?bo_table=test&wr_id=1 (끝 숫자만 다르죠...)
이중에서 wr_id=2 게시물의 내용을 불러 오려고 하는데 아래 소스를 어떻게 수정하면 될까요?
<?
$bo_table = 'test'; // 게시판
$row = sql_fetch("select wr_content from $g4[write_prefix]$bo_table where wr_is_comment=0 order by wr_num limit 1");
echo $row[wr_content];
?>
이 소스는 질답란의 http://www.sir.co.kr/bbs/board.php?bo_table=g4_qa&wr_id=68863 에서 퍼 온 겁니다.
wr_num limit 1는 마지막 한 게시물만 가져오라는 것이기 때문에
$row = sql_fetch("select wr_content from $g4[write_prefix]$bo_table where wr_is_comment=0 order by wr_id=2");
이렇게 바꿔 봤는데 잘 안 되네요...
그리고, wr_is_comment=0는 무슨 역활을 하는 거죠?
바쁘신데 질문을 읽어 주셔서 감사합니다. 꾸벅~
그 각 게시물의 주소는 아래와 같습니다.
http://<?$g4[path]?>/g4/board.php?bo_table=test&wr_id=3
http://<?$g4[path]?>/g4/board.php?bo_table=test&wr_id=2
http://<?$g4[path]?>/g4/board.php?bo_table=test&wr_id=1 (끝 숫자만 다르죠...)
이중에서 wr_id=2 게시물의 내용을 불러 오려고 하는데 아래 소스를 어떻게 수정하면 될까요?
<?
$bo_table = 'test'; // 게시판
$row = sql_fetch("select wr_content from $g4[write_prefix]$bo_table where wr_is_comment=0 order by wr_num limit 1");
echo $row[wr_content];
?>
이 소스는 질답란의 http://www.sir.co.kr/bbs/board.php?bo_table=g4_qa&wr_id=68863 에서 퍼 온 겁니다.
wr_num limit 1는 마지막 한 게시물만 가져오라는 것이기 때문에
$row = sql_fetch("select wr_content from $g4[write_prefix]$bo_table where wr_is_comment=0 order by wr_id=2");
이렇게 바꿔 봤는데 잘 안 되네요...
그리고, wr_is_comment=0는 무슨 역활을 하는 거죠?
바쁘신데 질문을 읽어 주셔서 감사합니다. 꾸벅~
댓글 전체
wr_is_comment=0 는 이게 코멘트냐 게시글이냐 구분입니다...
order by 이건 정렬구분이라서...
$row = sql_fetch("select wr_content from $g4[write_prefix]$bo_table where wr_is_comment=0 and wr_id=2");
이렇게 함해보세염...
order by 이건 정렬구분이라서...
$row = sql_fetch("select wr_content from $g4[write_prefix]$bo_table where wr_is_comment=0 and wr_id=2");
이렇게 함해보세염...
아.. 그걸 생각 못했네요.
감사합니다. ^^
감사합니다. ^^