내가 쓴글 불러오기 질문입니다. 정보
내가 쓴글 불러오기 질문입니다.본문
http://sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=124719&sca=&sfl=wr_subject%7C%7Cwr_content&stx=%EB%A7%88%EC%9D%B4%ED%8E%98%EC%9D%B4%EC%A7%80
위의 스킨형태의 마이페이지 스킨입니다.
<?
$count = 10;
$cnt = 0;
$sql = " select bo_table, wr_parent from $g4[board_new_table] a
where mb_id = '$member[mb_id]'
-- and a.wr_id = a.wr_parent
group by bo_table, wr_parent
order by bn_id desc
limit $count ";
$results = sql_query($sql);
echo "<table width=98% cellpadding=0 cellspacing=0 align=center border=1 rules=none>";
echo "<tr align=center><td colspan=2 height=20><b>제목</b></td><td><b>작성일</b></td></tr>";
echo "<tr><td colspan='3' background='$icon4'>$icon3</td></tr>";
for ($i=0; $row=sql_fetch_array($results), $i<$count; $i++)
{
if (!$row[bo_table])
{
continue;
}
$tmp_table = $g4[write_prefix].$row[bo_table];
$sql2 = " select wr_subject,wr_datetime,wr_comment from $tmp_table where wr_id = '$row[wr_parent]' ";
$row2 = sql_fetch($sql2);
$subject = cut_str(get_text($row2[wr_subject]), 22);
$dates = cut_str(get_text($row2[wr_datetime]), 22);
if ($row2[wr_comment])
$comment = "<span class=new>($row2[wr_comment])</span>";
echo "<tr><td width='20' >$icon2</td>";
echo "<td height='25' style='letter-spacing: -1px;'>";
echo "<a href='$g4[bbs_path]/board.php?bo_table=$row[bo_table]&wr_id=$row[wr_parent]'>$subject $comment </a>";
echo "</td><td width=22% align=center> $dates</td></tr>";
echo "<tr><td colspan='3' background='$icon4'>$icon3</td></tr>";
$cnt++; } if (!$cnt) echo "<tr><td colspan='3' height='50' align='center'>게시글이 없습니다.</td></tr>";
echo "</table>\n";
?>
여기서 특정 게시판만 불러올려면 어떻게해야하나요?
두번째는 게시판 여분필드 정보를 하나 불러와야되는데 방법좀 부탁드립니다.
위의 스킨형태의 마이페이지 스킨입니다.
<?
$count = 10;
$cnt = 0;
$sql = " select bo_table, wr_parent from $g4[board_new_table] a
where mb_id = '$member[mb_id]'
-- and a.wr_id = a.wr_parent
group by bo_table, wr_parent
order by bn_id desc
limit $count ";
$results = sql_query($sql);
echo "<table width=98% cellpadding=0 cellspacing=0 align=center border=1 rules=none>";
echo "<tr align=center><td colspan=2 height=20><b>제목</b></td><td><b>작성일</b></td></tr>";
echo "<tr><td colspan='3' background='$icon4'>$icon3</td></tr>";
for ($i=0; $row=sql_fetch_array($results), $i<$count; $i++)
{
if (!$row[bo_table])
{
continue;
}
$tmp_table = $g4[write_prefix].$row[bo_table];
$sql2 = " select wr_subject,wr_datetime,wr_comment from $tmp_table where wr_id = '$row[wr_parent]' ";
$row2 = sql_fetch($sql2);
$subject = cut_str(get_text($row2[wr_subject]), 22);
$dates = cut_str(get_text($row2[wr_datetime]), 22);
if ($row2[wr_comment])
$comment = "<span class=new>($row2[wr_comment])</span>";
echo "<tr><td width='20' >$icon2</td>";
echo "<td height='25' style='letter-spacing: -1px;'>";
echo "<a href='$g4[bbs_path]/board.php?bo_table=$row[bo_table]&wr_id=$row[wr_parent]'>$subject $comment </a>";
echo "</td><td width=22% align=center> $dates</td></tr>";
echo "<tr><td colspan='3' background='$icon4'>$icon3</td></tr>";
$cnt++; } if (!$cnt) echo "<tr><td colspan='3' height='50' align='center'>게시글이 없습니다.</td></tr>";
echo "</table>\n";
?>
여기서 특정 게시판만 불러올려면 어떻게해야하나요?
두번째는 게시판 여분필드 정보를 하나 불러와야되는데 방법좀 부탁드립니다.
댓글 전체
$sql = " select bo_table, wr_parent from $g4[board_new_table] a
where mb_id = '$member[mb_id]'
and a.wr_id = a.wr_parent
group by bo_table, wr_parent
order by bn_id desc
limit $count ";
$results = sql_query($sql);
이부분에
$sql = " select bo_table, wr_parent from $g4[board_new_table] a
where mb_id = '$member[mb_id]'
and a.wr_id = a.wr_parent
and bo_table='게시판명'
group by bo_table, wr_parent
order by bn_id desc
limit $count ";
$results = sql_query($sql);
이렇게해보세요
where mb_id = '$member[mb_id]'
and a.wr_id = a.wr_parent
group by bo_table, wr_parent
order by bn_id desc
limit $count ";
$results = sql_query($sql);
이부분에
$sql = " select bo_table, wr_parent from $g4[board_new_table] a
where mb_id = '$member[mb_id]'
and a.wr_id = a.wr_parent
and bo_table='게시판명'
group by bo_table, wr_parent
order by bn_id desc
limit $count ";
$results = sql_query($sql);
이렇게해보세요
잘되네요...감사합니다..