게시판에서
아래 조건으로 첫번째 파일의 br_file 을 불러 오려고 하는데 아래 소스를 어케 써내려 가야하는지 가르쳐 주세요.
$sql = " select * from g4_board_file where bo_table = '$bo_table' and wr_id = $view[wr_id] order by bf_no";
1111
댓글 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];
//파일 처리를 하시면 됩니다
}
$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];
}
}
//배열에 저장하신후 쓰시면 됩니다
$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];
}
}
//배열에 저장하신후 쓰시면 됩니다
게시글 목록
| 번호 | 제목 |
|---|---|
| 284438 | |
| 284437 | |
| 284435 | |
| 284430 | |
| 284420 | |
| 284417 | |
| 284409 | |
| 284401 | |
| 284399 | |
| 284397 | |
| 284380 | |
| 284378 | |
| 284371 | |
| 284370 | |
| 284366 | |
| 284364 | |
| 284360 | |
| 284357 | |
| 284355 | |
| 284354 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기