아래 같은 질문이잇는데...
수정이 안되서..다시올려봐요..
아래와 같은 php 배열이 있습니다. while을 이용해서 배열중인 소스인데. 아래 소스의 배열개수를 딱 6개까지만
출력하고 6개가 넘으면 출력을 안하게하려면 어찌해야하나요....?
$i <6; $db1_count < 6 .. 다해봣는데... 입력 위치떄문인지..안되네요.....왜그런가요 ?ㅠㅠ
Copy
$str="where join_check='2' and big_no='1' and item_icon1='1'";
$str_sort="order by bbs_sort_no desc";
$str_field="*";
$db1=$start_query->rowQuery($bbsname_item, $str, $str_sort, $str_field);
$db1_count=mysql_num_rows($db1);
if($db1_count > 0 )
{
$i=1;
$chop_no=20;
while($bbsdata=mysql_fetch_object($db1))
{
$img_type = &$bbsdata->file_type;
$img_name = "../wi_files/item_thum/".$bbsdata->bbs_no.".".$img_name_array[$img_type];
if($bbsdata->file_name !='')
{
$img_name = "../wi_files/item_any/".$bbsdata->file_name;
}
?>
<li class='itemlist_li' ></li>
<?
$i++; } } else {?>
{
?>
<li style="width: 880px; heifhr: 500px;" class="glo_li txt_ac">
</li>
<?php
}
?>
</ul>
답변 1개
채택된 답변
+20 포인트
2014-03-31 (월) 12:47:03
$i++;
if ($i > 60)
break;
해결
답변을 작성하려면 로그인이 필요합니다.