날자가 뒤죽박죽 되어서 이거 날자 정렬 관련

날자가 뒤죽박죽 되어서 이거 날자 정렬 관련

QA

날자가 뒤죽박죽 되어서 이거 날자 정렬 관련

본문

f_datestr 에 날자가 정렬이 맞지 않아서 이거 정렬을 하려면 어떻게 처리를 해야 할까요 

2049131254_1701847062.4501.png

 

혹시 몰라서 소스 올려 드립니다


<?php
$daesu = htmlentities($daesu);
//$fcode = htmlentities($fcode);
$nowpage = htmlentities($nowpage);
$totalpage = htmlentities($totalpage);
$c_code = htmlentities($c_code);
$mode = htmlentities($mode);
$cont = htmlentities($cont);
if($cont != "yes") {
   $totalrec = 0;
   $qry = "select f_name1 from tbl_speaker where  f_mcode = '".$c_code."'";
   $rs = _query($qry);
   if(!$rs) {
        print("<br /><br /><center>발언자를 검색하는 중에 에러가 발생했습니다(1).</center>");
    }
   $totalrec = _num_rows($rs);
}  /* end of nextpage */
if($totalrec > 0) {
   if(!$nowpage) {
        $nowpage = 1;
    }
    $totalpage = ceil($totalrec / 10);
    $blockpage = floor(($nowpage - 1) / 10) +1;
    
    $startpage = ($blockpage - 1) * 10 + 1;
    $endpage = $blockpage * 10;
    if($totalpage < $endpage) {
        $endpage = $totalpage;
    }
    $firstrec = ($nowpage - 1) * 10;
    $cnt = $totalrec - $firstrec;
    if($cnt > 10) {
        $cnt = 10;
    }
  $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("<br /><br /><center>발언자를 검색하는 중에 에러가 발생했습니다(2).</center>");
  }
    while($row = mysql_fetch_array($rs)) {
        $no = $totalrec - $i;
        $i++;
        $mname = urlencode($row[f_name1]."-".$row[f_name2]);
        $row[f_etc1] = str_replace("유성구의회", "", $row[f_etc1]);

        // 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]."회";
            }
        }

        $strTh = $f_th." ".$row[f_chastr]." ".$row[f_etc1]."(".$row[f_datestr].")";
        $qryan = "select * from tbl_angun where f_file = '".$row[f_file]."' order by f_angunno asc";
        $rsan = mysql_query($qryan);
        if(!$rsan) {
        print "<br /><br /><br /><center><b>데이타를 검색하는 중에 에러가 발생했습니다(5).</b></center>";
        }
    ?>
    <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>
     <? } ?>
<? } ?>

이 질문에 댓글 쓰기 :

답변 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;

답변을 작성하시기 전에 로그인 해주세요.
전체 290
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT