상품 2개씩 출력 문의 드림니다.
$result=mysql_query('SELECT it_img1 ,it_id, it_name, it_price FROM g5_shop_item WHERE it_type4="1" ' );
while($row = mysql_fetch_array($result)){
echo "
border=1>
".$row[it_name]." ".$row[it_price]."?>
지금 현재 이렇게 해서 인기상품을 한줄에 하나 씩은 출력 됨니다.
이것을 한줄에 2개의 상품을 출력 하고 싶은대.. 어떻게 해야 하나요?
몇일 동안 이렇게 저렇게 해 보는대.. 지식이 부족하군요.. 도움을 청합니다.
댓글을 작성하려면 로그인이 필요합니다.
답변 1개
11년 전
echo 문을 조금 바꾸면 되지 않을까요.
</p><p><span style="font-family: gulim, helvetica; line-height: 23.54400062561035px; font-size: 12px; background-color: rgb(255, 255, 255);"><?</span></p><p style="line-height: 23.54400062561035px; word-break: break-all; font-family: gulim, helvetica; background-color: rgb(255, 255, 255);">$result=mysql_query('SELECT it_img1 ,it_id, it_name, it_price FROM g5_shop_item WHERE it_type4="1" ' );</p><p style="line-height: 23.54400062561035px; word-break: break-all; font-family: gulim, helvetica; background-color: rgb(255, 255, 255);">$n=1;</p><p style="line-height: 23.54400062561035px; word-break: break-all; font-family: gulim, helvetica; background-color: rgb(255, 255, 255);">while($row = mysql_fetch_array($result)){</p><p style="line-height: 23.54400062561035px; word-break: break-all; font-family: gulim, helvetica; margin-left: 40px; background-color: rgb(255, 255, 255);">if($n%2==1) echo "<div class='test'>";</p><p style="line-height: 23.54400062561035px; word-break: break-all; font-family: gulim, helvetica; margin-left: 40px; background-color: rgb(255, 255, 255);">echo "<a href='/shop/item.php?it_id=".$row[1]."'><img src=/data/item/".$row[0]." width=130 </p><p style="line-height: 23.54400062561035px; word-break: break-all; font-family: gulim, helvetica; background-color: rgb(255, 255, 255);"> border=1></a>
".$row[it_name]."
".$row[it_price]; </p><p style="line-height: 23.54400062561035px; word-break: break-all; font-family: gulim, helvetica; margin-left: 40px; background-color: rgb(255, 255, 255);">if($n%2==0) echo "</div>";</p><p style="line-height: 23.54400062561035px; word-break: break-all; font-family: gulim, helvetica; margin-left: 40px; background-color: rgb(255, 255, 255);"><span style="font-size: 12px;">$n++;</span></p><p style="line-height: 23.54400062561035px; word-break: break-all; font-family: gulim, helvetica; background-color: rgb(255, 255, 255);">}</p><p><span style="font-family: gulim, helvetica; line-height: 23.54400062561035px; font-size: 12px; background-color: rgb(255, 255, 255);">?> </span><span id="husky_bookmark_end_1406574553205"></span> </p><p>
로그인 후 평가할 수 있습니다
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인전체 질문 목록
채택
채택
답변대기
답변대기
채택
채택
채택
채택
채택
채택
채택
채택
답변대기
채택
답변대기
답변대기
채택
채택
답변대기
채택