php 구문좀봐주세요...1800점 정보
php 구문좀봐주세요...1800점본문
제가 메인 페이지에
특정 게시판의 특정 게시물의 내용만 뽑아오는 php구문을 쓰고싶은데요..
<?
$bo_table = 'main'; // 게시판
$wr_num = 2; // 게시물
$qry = sql_query("select * from $g4[write_prefix]$bo_table where wr_is_comment=0 order by wr_num");
while ($row = sql_fetch_array($qry))
{
echo "<div>$row[wr_content]</div>";
}
$bo_table = 'main'; // 게시판
$wr_num = 2; // 게시물
$qry = sql_query("select * from $g4[write_prefix]$bo_table where wr_is_comment=0 order by wr_num");
while ($row = sql_fetch_array($qry))
{
echo "<div>$row[wr_content]</div>";
}
?>
이렇게쓰니 그냥 전체게시물의 글내용이 다떠버리네요..ㅠㅠ
특정 게시물의 내용만 뽑아오고싶은데.. 저기서 뭘수정해야할까요,.,
포인트드릴께요 -0-
댓글 전체
where wr_is_comment = '0' and wr_id = '1' order by wr_num");
^ ^
^ ^
where wr_id = '1' or wr_id = '5' or wr_id = '22' or wr_id = '23' order by wr_num");
1번 5번 22번 23번을 뽑아요~
wr_is_comment = '0' 조건은 필요없겠네요.
1번 5번 22번 23번을 뽑아요~
wr_is_comment = '0' 조건은 필요없겠네요.
말씀해주신데로 붙였는데 Fatal error: Call to undefined function: sql_query() 에러가뜨네요 ㅠㅠ
아 제가잘못썼네요 ^^ 감사합니다