답변 3개
</p>
<p><div class="index_botoom_img_content"></p>
<p><?php</p>
<p>$sql = "SELECT * FROM `g5_write_clean_gallery` ORDER BY `wr_id` DESC LIMIT 10";</p>
<p>$result = mysqli_query($connect_db, $sql);</p>
<p>$gallery = array();</p>
<p>$galleryfile = array();</p>
<p>for($i=0; $row = mysqli_fetch_assoc($result); $i++){</p>
<p> $gallery[$i] = $row;</p>
<p> </p>
<p> $sql2 = "SELECT * FROM g5_board_file WHERE bf_no = 0 AND bo_table = 'clean_gallery' AND wr_id='{$row['wr_id']}'";</p>
<p> $result2 = mysqli_query($connect_db, $sql2);</p>
<p> $row2 = mysqli_fetch_assoc($result2);</p>
<p> $galleryfile[$i] = $row2;</p>
<p>}</p>
<p>?></p>
<p> <div class="gallery_wrap"></p>
<p> <?php</p>
<p> for($i = 0; $i < count($gallery); $i++){ ?></p>
<p> <a href="<?php echo '/bbs/board.php?bo_table=clean_gallery&wr_id='.$gallery[$i]['wr_id']; ?>" class="gallery_box"></p>
<p> <div class="gal_img"></p>
<p> <img src="<?php echo G5_DATA_URL ?>/file/clean_gallery/<?php echo $galleryfile[$i]['bf_file']; ?>" alt=""></p>
<p> </div></p>
<p> <div class="gal_text"></p>
<p> <p><?php echo $gallery[$i]['wr_subject']; ?></p></p>
<p> </div></p>
<p> </a></p>
<p> <?php }</p>
<p> ?></p>
<p> </div></p>
<p> </p>
<p></div></p>
<p>
댓글을 작성하려면 로그인이 필요합니다.
</strong></p>
<p><strong><div class="index_botoom_img_content">
<?php
$sql = "SELECT * FROM `g5_write_clean_gallery` ORDER BY `wr_id` DESC LIMIT 10";
$sql2 = "SELECT * FROM g5_board_file WHERE bf_no = 0 AND bo_table = 'clean_gallery'";
$result = mysqli_query($connect_db, $sql);
$result2 = mysqli_query($connect_db, $sql2);
$gallery = [];
$galleryfile = [];
while($row = mysqli_fetch_assoc($result)){
$gallery[] = $row;
}
while($row = mysqli_fetch_assoc($result2)){
$galleryfile[] = $row;
}
?></strong></p>
<p><strong> <div class="gallery_wrap">
<?php
for($i = 0; $i < count($gallery); $i++){ ?>
<a href="<?php echo '/bbs/board.php?bo_table=clean_gallery&wr_id='.$gallery[$i]['wr_id']; ?>" class="gallery_box">
<div class="gal_img">
<img src="<?php echo G5_DATA_URL ?>/file/clean_gallery/<?php echo $galleryfile[$i]['bf_file']; ?>" alt="">
</div>
<div class="gal_text">
<p><?php echo $gallery[$i]['wr_subject']; ?></p>
</div>
</a>
<?php }
?>
</div></strong></p>
<p>
<strong> </div></strong>
</p>
<p><strong>
댓글을 작성하려면 로그인이 필요합니다.
첫번째 게시물을 가져온 데이터에서 다시 파일을 가져오면 됩니다.
(소스로 올려주셔야 답변이 용이합니다.ㅜㅜ)
while($row = mysqli_fetch_assoc($result)) {
$gallery{} = $row;
$sql2 = "select * from g5_board_file where bo_table='clean_gallery' and wr_id='{$row['wr_id']}' and bf_no=0";
$result2 = ~~~
while($row2 = ~~~~) {
$galleryfile[] = $row2;
}
}
답변에 대한 댓글 1개
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인