이미지 불러오기인데요. 고수님들 한번 봐주세요 정보
이미지 불러오기인데요. 고수님들 한번 봐주세요
본문
$sql3 = " select bf_file, bf_datetime from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '{$wr_idvm}' and bf_type in (1,2,3) ";
$result3=mysql_query($sql3);
for($i=0 ; $row3 = mysql_fetch_array($result3) ; $i++){
$imgfileavm= "<img src =$g4[path]/data/file/$bo_table/$row3[bf_file] width=70 height=80 border=0>";
}
위의 소스는 이미지 불러오기는 하는데 좀 이상하게? 불러오네요.
1. 이미지 10개를 한꺼번에 등록하는데요 원하는건 그중 첫번째이미지만을 불러오고 싶구요.
2. 등록되지 않는 이미지는 따로 noimg.gif로 넘기고 싶습니다.
고수님들 부탁드려요^^
$result3=mysql_query($sql3);
for($i=0 ; $row3 = mysql_fetch_array($result3) ; $i++){
$imgfileavm= "<img src =$g4[path]/data/file/$bo_table/$row3[bf_file] width=70 height=80 border=0>";
}
위의 소스는 이미지 불러오기는 하는데 좀 이상하게? 불러오네요.
1. 이미지 10개를 한꺼번에 등록하는데요 원하는건 그중 첫번째이미지만을 불러오고 싶구요.
2. 등록되지 않는 이미지는 따로 noimg.gif로 넘기고 싶습니다.
고수님들 부탁드려요^^
댓글 전체
동일 wr_id and bf_type 1,2,3 and bf_no 오름차순 정렬 상태 1개
$sql3 = " select bf_file, bf_datetime from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '{$wr_idvm}' and bf_type in (1,2,3) order by bf_no asc limit 1";
$result3=mysql_query($sql3);
$row3 = mysql_fetch_array($result3);
echo $imgfileavm = "<img src =$g4[path]/data/file/$bo_table/$row3[bf_file] width=70 height=80 border=0>";
테스트 해 보세요.
$sql3 = " select bf_file, bf_datetime from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '{$wr_idvm}' and bf_type in (1,2,3) order by bf_no asc limit 1";
$result3=mysql_query($sql3);
$row3 = mysql_fetch_array($result3);
echo $imgfileavm = "<img src =$g4[path]/data/file/$bo_table/$row3[bf_file] width=70 height=80 border=0>";
테스트 해 보세요.
감사합니다^^ 첫째이미지는 잘나옵니다.^^