테스트 사이트 - 개발 중인 베타 버전입니다

날자가 뒤죽박죽 되어서 이거 날자 정렬 관련 채택완료

꿈의세계 1년 전 조회 2,037

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];?>&amp;daesu=<?=$row[f_daesu];?>&amp;mname=<?=$mname;?>&amp;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개

채택된 답변
+20 포인트
1년 전

$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개

꿈의세계
1년 전
답변 감사 드립니다.
이게 최근 날짜가 제일 위로 올라와야 하는데 맨 뒤로 가서요 이건 어떻게
마르스컴퍼니
1년 전
f_datestr desc
꿈의세계
1년 전
역시 천제시네요 감사합니다

댓글을 작성하려면 로그인이 필요합니다.

1년 전

요일 필드를 추가해서 분리하시는 걸 추천해 드립니다.

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인