게시판에 댓글을 쓰며 항상 맨뒤에 올라오는데요
새로 작성한 댓글이 맨위로 올라오게 하려면 어떻게해야 되나요?
새로 작성한 댓글이 맨위로 올라오게 하려면 어떻게해야 되나요?
댓글을 작성하시려면 로그인이 필요합니다.
댓글 4개
위에 있는 주석친걸 풀어주고 아래껄 주석처리하시면 됩니다.
// 코멘트 출력
//$sql = " select * from $write_table where wr_parent = '$wr_id' and wr_is_comment = 1 order by wr_comment desc, wr_comment_reply ";
$sql = " select * from $write_table where wr_parent = '$wr_id' and wr_is_comment = 1 order by wr_comment, wr_comment_reply ";
// 코멘트 출력
$sql = " select * from $write_table where wr_parent = '$wr_id' and wr_is_comment = 1 order by wr_comment, wr_comment_reply ";
이부분이 있습니다. order by 가 정렬을 해주는 것이지요
order by wr_datetime asc 나 desc 로 바꿔주시면 됩니다. asc 오름차순 desc는 내림차순.