연혁 게시판 만들고 있는데 도와주세용 ㅠ
본문
여러 연혁 스킨들 참고하며 만들어보고 있는데 어렵네요 ㅠㅠ
현재 나오는 화면이랑 소스구요
<ul class="list">
<?
$sql = "select * from ".$write_table." where wr_is_comment = '0' group by wr_subject order by wr_subject desc";
$result = sql_query($sql);
for ($i=0; $history_y=sql_fetch_array($result); $i++) {
?>
<li class="list-item">
<dl>
<dt class="year"><?=$history_y['wr_subject']?></dt>
<dd>
<?
$sql2 = "select * from ".$write_table." where wr_is_comment = '0' and wr_subject = '{$history_y[wr_subject]}' group by wr_1 order by wr_1 desc";
$result2 = sql_query($sql2);
for ($i=0; $history_m=sql_fetch_array($result2); $i++) {
?>
<ul class="content">
<li class="month"><?=$history_m['wr_1']?></li>
<li class="history">
<?
$sql3 = "select * from ".$write_table." where wr_is_comment = '0' and wr_1 = '{$history_m[wr_1]}' order by wr_10 desc, wr_datetime desc";
$result3 = sql_query($sql3);
for ($i=0; $history_d=sql_fetch_array($result3); $i++) {
$thumb = get_list_thumbnail($bo_table, $history_d['wr_id'], 300, 0);
?>
<? if ($thumb) { ?>
<div class="img reveal"><img src="<?=$thumb['src']?>" /></div>
<? } ?>
<div class="desc">
<label>
<? if ($is_admin) { ?><input type="checkbox" name="chk_wr_id[]" value="<?=$history_d['wr_id']?>" id="chk_wr_id_<?=$i?>" class="modify"><? } ?>
<span><?=nl2br($history_d['wr_content']);?></span>
</label>
<? if ($is_admin) { ?><a href="<?=G5_BBS_URL?>/write.php?w=u&bo_table=<?=$bo_table?>&wr_id=<?=$history_d['wr_id']?>" class="modify">수정</a><? } ?>
</div>
<? } ?>
</li>
</ul>
<? } ?>
</dd>
</dl>
</li>
<? } ?>
</ul>
2020년 12월에 게시글이 1개 있고
2016년 12월에 게시글이 2개 있는건데
이렇게 나오네요ㅠㅠㅠ
제가 구현하고 싶은건
동일한 년/월에 게시글을 여러개 등록 할 수 있어서
각 게시글마다 따로 이미지를 업로드 할 수 있게 하고 싶거든요
며칠동안 머리싸매고 검색 해보고 있는데 프로그램을 배운적이 없어서 도저히 모르겠네요ㅠㅠ
도와주세요 고수님덜! ㅠ^ㅠ
!-->
답변 2
$sql3 = "select * from ".$write_table." where
wr_is_comment = '0'
and wr_subject = '{$history_y[wr_subject]}' 이 조건이 빠졌네요.
and wr_1 = '{$history_m[wr_1]}' order by wr_10 desc, wr_datetime desc";
년도를 카테고리로 빼고
카테고리 > 해당카테고리 게시물
순으로 뽑는다면 각 게시물마다 이미지를 올릴수있을거같네요
답변을 작성하시기 전에 로그인 해주세요.