일정추출시 날짜순 정렬문제 채택완료

위와같이 중간에 등록하거나 수정을하면 상단에 배치되는데요
20150101
20150102
20150103
중간에 등록하든 상관없이
요로케 날짜별로 정렬되게 하는 법 없을까요?
오름차순이면 더 좋구요~~
</strong></p><p><strong>
</strong></p><p><strong><?
</strong></p><p><strong>
</strong></p><p><strong>?></strong></p><p><strong>
<table width=100% cellpadding=0 cellspacing=0></strong></p><p><strong><? for ($i=0; $i<count($list); $i++) { ?>
<tr>
<td colspan=4 align=center>
<table width=280>
<tr>
<td height=20 align="left"><img src="<a href='<a href="http://jjcy.or.kr/skin/latest/bara_latest/img/latest_icon.gif" target="_blank" rel="noopener noreferrer">http://jjcy.or.kr/skin/latest/bara_latest/img/latest_icon.gif</a>">  '><a href="http://jjcy.or.kr/skin/latest/bara_latest/img/latest_icon.gif" target="_blank" rel="noopener noreferrer">http://jjcy.or.kr/skin/latest/bara_latest/img/latest_icon.gif</a>">  </a>; </strong></p><p><strong>
<?
$date = substr($list[$i]['link'][1], 7);
echo $date;</strong></p><p><strong> ?></strong></p><p><strong>
<?
echo $list[$i]['icon_reply'] . " ";
echo "<a href='{$list[$i]['href']}'>";
if ($list[$i]['is_notice'])
echo "<font style='font-family:돋움; font-size:10pt; color:#2C88B9;'><strong>{$list[$i]['subject']}</strong></font>";
else
echo "<font style='font-family:돋움; font-size:10pt; color:#6A6A6A;'>{$list[$i]['subject']}</font>";
echo "</a>";</strong></p><p><strong>
?>
</td></tr>
</table></td>
</tr>
<tr><td height='1' colspan='2' background='<?=$g4[path]?>/2014_index/line.gif'></td></tr></strong></p><p><strong><? } ?></strong></p><p><strong><? if (count($list) == 0) { ?><tr align=left><td colspan=4 align=center height=50><font color=#6A6A6A>게시물이 없습니다.</a></td></tr><? } ?></strong></p><p><strong></table>
</strong></p><p><strong>
</strong></p><p><strong>
답변 1개
$list를 뽑아오는 쿼리문을 보여주세요 ^^
쿼리문으로 정렬하는거라 쿼리문 뒤의 order by 날짜 desc 하시면 되요~
답변에 대한 댓글 8개
추출이라면 추출할때 무슨함수 사용하셨는지 보시고 (ex. latest1("ddd", "dd")이런거) 그에 해당하는 함수를 보여주셔야해요 ^^
언능 찾아보겠습니당 ㅋㅋ
두번째줄 //를 풀고 원래 활성화되어있던 세번째줄 소스를 //막으니 ㅋ 사이트가 안떠서 금새 원상태로 바꿨어요 ㅋ
깜놀~
아래 소스가 맞을까요??
[code] $tmp_write_table = $g4['write_prefix'] . $bo_table; // 게시판 테이블 전체이름
//$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_id desc limit 0, $rows ";
// 위의 코드 보다 속도가 빠름
$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_num limit 0, $rows ";
//explain($sql);
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++)
$list[$i] = get_list($row, $board, $latest_skin_path, $subject_len);
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
return $content;
} [/code]
추출 소스입니당 ㅋ
fucntion latest2(....){}
이렇게 시작하는거 맞으시죠?
$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_num limit 0, $rows ";
이게 맞는 쿼리문이라면 wr_num을 날짜가 저장되어있는 컬럼이름으로 바꿔주시고 뒤에 desc적어주시면되요.
요것저것 건들어봤는데 제가 아무래도 못알아들은듯합니다 ㅋㅋ
바꿨다가 ㅋㅋ 오류메시지뜨면서 화면이 안떠서 크흐흣 다 되돌려놓느라 이시간되었네요 ㅋ
죄송합니다 ㅋ
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인
어느파일을 찾아봐야할런지요 (^-^*)a 으흐흐