while 문 질문 입니다.
본문
<?
$tname = "education_course";
$num_per_page = 4;
//기본쿼리 - 현재모집중인것만 셀렉트
$sql_board = "SELECT * FROM ".$tname." where idx!='' and e_state=1 and e_category=4";
$cntRcd = countRecordSql($db, $tname, $key, $keystring, $num_per_page, $page , $sql_board );
$sql_board = $sql_board . " order by idx desc LIMIT ".$cntRcd[0]." , ".$num_per_page ;
$res = $db->Query($sql_board);
$cnt = 0;
while($row = mysql_fetch_array($res))
{
if($row[e_category]==1) $category_img = '<img src="../images/main/online_icon1.gif" border="0" alt="우선선정직종" align="absmiddle">';
if($row[e_category]==2) $category_img = '<img src="../images/main/online_icon2.gif" border="0" alt="실업자과정" align="absmiddle">';
if($row[e_category]==3) $category_img = '<img src="../images/main/online_icon3.gif" border="0" alt="계좌제과정" align="absmiddle">';
if($row[e_category]==4) $category_img = '<img src="../images/main/online_icon4.gif" border="0" alt="제직자과정" align="absmiddle">';
if($row[e_category]==5) $category_img = '<img src="../images/main/online_icon5.gif" border="0" alt="일반/방학특강" align="absmiddle">';
if($row[e_category]==6) $category_img = '<img src="../images/main/online_icon6.gif" border="0" alt="위탁교육" align="absmiddle">';
?>
<tr>
<td class="m-latest-name"><?=$category_img?> <?=$classStrCut->cut($row[e_name],150)?></td>
<td class="m-latest-date"><?=date("Y.m.d",$row[e_opendate])?>(<?=$row[e_time]?>)</td>
<td class="m-latest-link"><a href="../community/nboard_list.htm?mode=write&tname=nboard_board"><img src="../images/main/online_btn.gif"></a></td>
</tr>
<?
}
?>
for문은 알겠는데 while문은 이럴경우
if(데이터가 없으면) { echo"데이터가 없습니다."; } 이걸 어떻게 처리해야 하나요?
!-->
답변을 작성하시기 전에 로그인 해주세요.