최근게시물 이미지 랜덤으로 추출하는방법 알고싶습니다 꼭좀 알려주세요 정보
최근게시물 이미지 랜덤으로 추출하는방법 알고싶습니다 꼭좀 알려주세요본문
현재 사용하고 있는 최근게시물 php입니다.
<?
if (!defined("_GNUBOARD_")) exit; //개별 페이지 접근 불가
?>
<table border='0' cellpadding='0' cellspacing='0'>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><?
for ($i = 0; $i < count($list); $i++) {
$file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
echo "<td align='center'><a href='{$list[$i]['href']}'><img src='$file' width='60' border='0' height='60'></a><br></td>";
if($i=='4' || $i=='8'|| $i=='12'|| $i=='16'|| $i=='20'|| $i=='24'|| $i=='28'|| $i=='32'|| $i=='36'|| $i=='40'){
}
}
?></td>
</tr>
</table>
이렇게 해서 지금 메인화면에 추출하고 있는데요.
랜덤으로 이미지를 추출하려면 여기서 뭘 추가 해야 할까요? 초보라서 그런데 꼭좀 부탁드립니다.
<?
if (!defined("_GNUBOARD_")) exit; //개별 페이지 접근 불가
?>
<table border='0' cellpadding='0' cellspacing='0'>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><?
for ($i = 0; $i < count($list); $i++) {
$file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
echo "<td align='center'><a href='{$list[$i]['href']}'><img src='$file' width='60' border='0' height='60'></a><br></td>";
if($i=='4' || $i=='8'|| $i=='12'|| $i=='16'|| $i=='20'|| $i=='24'|| $i=='28'|| $i=='32'|| $i=='36'|| $i=='40'){
}
}
?></td>
</tr>
</table>
이렇게 해서 지금 메인화면에 추출하고 있는데요.
랜덤으로 이미지를 추출하려면 여기서 뭘 추가 해야 할까요? 초보라서 그런데 꼭좀 부탁드립니다.
Fatal error: Uncaught TypeError: mysqli_fetch_assoc(): Argument #1 ($result) must be of type mysqli_result, null given in /home/kagla/new-sir/old/lib/common.lib.php:2339 Stack trace: #0 /home/kagla/new-sir/old/lib/common.lib.php(2339): mysqli_fetch_assoc() #1 /home/kagla/new-sir/old/skin/board/v16/view.skin.php(795): sql_fetch_array() #2 /home/kagla/new-sir/old/bbs/view.php(403): include_once('...') #3 /home/kagla/new-sir/old/bbs/board.php(300): include_once('...') #4 {main} thrown in /home/kagla/new-sir/old/lib/common.lib.php on line 2339