날자가 뒤죽박죽 되어서 이거 날자 정렬 관련 채택완료
f_datestr 에 날자가 정렬이 맞지 않아서 이거 정렬을 하려면 어떻게 처리를 해야 할까요

혹시 몰라서 소스 올려 드립니다
</strong></p>
<p><?php</p>
<p>$daesu = htmlentities($daesu);
//$fcode = htmlentities($fcode);
$nowpage = htmlentities($nowpage);
$totalpage = htmlentities($totalpage);
$c_code = htmlentities($c_code);
$mode = htmlentities($mode);
$cont = htmlentities($cont);</p>
<p>if($cont != "yes") {
$totalrec = 0;</p>
<p> $qry = "select f_name1 from tbl_speaker where f_mcode = '".$c_code."'";</p>
<p> $rs = @mysql_query($qry);
if(!$rs) {
print("
<center>발언자를 검색하는 중에 에러가 발생했습니다(1).</center>");
}
$totalrec = @mysql_num_rows($rs);
} /* end of nextpage */</p>
<p>if($totalrec > 0) {
if(!$nowpage) {
$nowpage = 1;
}</p>
<p> $totalpage = ceil($totalrec / 10);
$blockpage = floor(($nowpage - 1) / 10) +1;
$startpage = ($blockpage - 1) * 10 + 1;
$endpage = $blockpage * 10;</p>
<p> if($totalpage < $endpage) {
$endpage = $totalpage;
}</p>
<p> $firstrec = ($nowpage - 1) * 10;
$cnt = $totalrec - $firstrec;
if($cnt > 10) {
$cnt = 10;
}</p>
<p> $i = $firstrec;
$qry = "select * from tbl_speaker where f_mcode = '".$f_code."' order by f_th desc,f_code asc,f_cha asc limit ".$firstrec.", ".$cnt;
$rs = mysql_query($qry);
if(!$rs) {
print("
<center>발언자를 검색하는 중에 에러가 발생했습니다(2).</center>");
}</p>
<p> while($row = mysql_fetch_array($rs)) {
$no = $totalrec - $i;
$i++;</p>
<p> $mname = urlencode($row[f_name1]."-".$row[f_name2]);</p>
<p> $row[f_etc1] = str_replace("유성구의회", "", $row[f_etc1]);</p>
<p>
// 2019-09-26 js
if($row[f_cha] == 0 || $row[f_cha] == 99) {
$f_th = "제".$row[f_th]."회";
}
else {
if(strchr($row[f_code], "H")) {
$f_th = $row[f_th]."년도 행정사무감사";
}
else {
$f_th = "제".$row[f_th]."회";
}
}</p>
<p>
$strTh = $f_th." ".$row[f_chastr]." ".$row[f_etc1]."(".$row[f_datestr].")";</p>
<p> $qryan = "select * from tbl_angun where f_file = '".$row[f_file]."' order by f_angunno asc";
$rsan = mysql_query($qryan);
if(!$rsan) {
print "
<center><b>데이타를 검색하는 중에 에러가 발생했습니다(5).</b></center>";
}</p>
<p> ?></p>
<p> <tr>
<td scope="row" class="no"><?=$no--;?>.</td>
<td class="con"> <a href="/CLRecords/Retrieval2/index.php?hfile=<?=$row[f_file];?>&daesu=<?=$row[f_daesu];?>&mname=<?=$mname;?>&mode=speaker1#w1" onclick="window.open(this.href, 'late', 'scrollbars=yes,width=1024,height=768'); return false;" title="<?=$strTh;?>(새창)"><?=$strTh;?></a></td>
</tr></p>
<p> <? } ?></p>
<p><? } ?></p>
<p><strong>
답변 2개
$qry = "select * from tbl_speaker where f_mcode = '".$f_code."' order by f_th desc,f_code asc,f_cha asc limit ".$firstrec.", ".$cnt;
→
$qry = "select * from tbl_speaker where f_mcode = '".$f_code."' order by f_datestr asc, f_th desc,f_code asc,f_cha asc limit ".$firstrec.", ".$cnt;
답변에 대한 댓글 3개
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인
이게 최근 날짜가 제일 위로 올라와야 하는데 맨 뒤로 가서요 이건 어떻게