띨

게시판에서 파일 주소 불러오는소스..

· 2012-12-06 (목) 01:07:50 · 1083 · 5
게시판에서 아래 조건으로 첫번째 파일의 br_file 을 불러 오려고 하는데 아래 소스를 어케 써내려 가야하는지 가르쳐 주세요. $sql = " select * from g4_board_file where bo_table = '$bo_table' and wr_id = $view[wr_id] order by bf_no";
|

댓글 5개

파일을 어떻게 처리 하실지 몰라서

$is_file = false;
$file_path = $g4[path]/data/file/$bo_table/";
$sql = " select * from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '$wr_id' order by bf_no ";
$result = sql_query($sql);
while ($row = sql_fetch_array($result))
{
if($row[bf_file] && file_exists($file_path.$row[bf_file]))
{
$is_file = true;
break;
}
}
if($is_file)
{
//파일경로 $file = $file_path.$row[bf_file];
//파일 처리를 하시면 됩니다
}
이 소스 맞습니다.갑사해요.^^
근데 이조건으로 파일 을 다 불러오려면 어케 해야 되죠?
$file_array = array();
$is_file = false;
$file_path = $g4[path]/data/file/$bo_table/";
$sql = " select * from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '$wr_id' order by bf_no ";
$result = sql_query($sql);
while ($row = sql_fetch_array($result))
{
if($row[bf_file] && file_exists($file_path.$row[bf_file]))
{
$file_array[] =$file_path.$row[bf_file];
}
}

//배열에 저장하신후 쓰시면 됩니다
정말 감사합니다.^^
소스 좀 수정 해서 해결 했습니다,
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

66,531건

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
12-12-06 조회 1,238
12-12-06 조회 1,594
12-12-06 조회 1,662
12-12-06 조회 845
12-12-06 조회 864
12-12-06 조회 796
12-12-06 조회 899
12-12-06 조회 1,701
12-12-06 조회 1,072
12-12-06 조회 991
12-12-06 조회 862
12-12-06 조회 1,066
12-12-06 조회 2,425
12-12-06 조회 1,738
12-12-06 조회 1,226
12-12-06 조회 1,084
12-12-06 조회 2,761
12-12-06 조회 1,108
12-12-05 조회 1,671
12-12-05 조회 1,648