for문인데 도움 주세요 ㅠ

for문인데 도움 주세요 ㅠ

QA

for문인데 도움 주세요 ㅠ

답변 3

본문

 

 

 


     <div class="box-title">공지사항<a class="noticemore" href=""><i class="fa fa-plus"></i></a></div>
      <ul>
       <?
       $notice_row = sql_fetch("select count(*) as cnt from wp_g5_write where bo_table='notice' order by wr_id desc");
       $notice_count = $notice_row[cnt];
       $notice_sql = "select * from wp_g5_write where bo_table='notice' order by wr_id desc";
       $notice_result = sql_query($notice_sql);
       for($i=0;$notice_row=sql_fetch_array($notice_result);$i++){?>
     
       <li>[<?=date("y/m/d",strtotime($notice_row[wr_datetime]))?>] <a href=""><?=get_text(cut_str($notice_row[wr_subject'>http://www.webshow.kr?page_id=2530&wr_id=<?=$notice_row[wr_id]?>"><?=get_text(cut_str($notice_row[wr_subject], 60))?></a></li>
       <?}if($notice_count == 0){?>
       <li>등록된 공지사항이 없습니다.</li>
       <?}?>
      </ul>
     </div>

 

이렇게 되서 게시물 최근글을 반복 추출하게 되어 있는데요.

 

for문이 무한반복되고 있어서

 for($i=0;$notice_row=sql_fetch_array($notice_result);$i++){?>

 

 조건부분에 < 5를 걸고 싶은데 어떻게 걸어야 하나요.ㅠ

 

이 질문에 댓글 쓰기 :

답변 3

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 125,873
© SIRSOFT
현재 페이지 제일 처음으로