일반페이지에 게시판파일이미지 불러오기 정보
일반페이지에 게시판파일이미지 불러오기본문
아래보면 게시판제목및내용은 잘불러지는데... 그에다른 이미지가 안불러지네요
머가 잘못되었는지 고수님들 부탁좀 드릴게요
<?
$g4_path = "./";
include_once("$g4_path/common.php");
$connect = mysql_connect("localhost","xxxxxx","xxxxx") or die("접속불가");
mysql_select_db("xxxxx");
if(!$options) $options=3;
$cols = $options; // 이미지 가로갯수 // 이미지 세로 갯수는 메인에서 지정(총 이미지 수)
$image_h = 12; // 이미지 상하 간격
$col_width = (int)(99 / $cols);
$data_path = $g4[path]."/data/file/xxx";
//$thumb_path = $data_path.'/thumb';
$thumb_path = $data_path.'/latest_thumb';
$one_rows = "10"; // 출력수량
$one_count_sql = " select count(*) as cnt from g4_write_xxx where wr_is_comment = 0 order by wr_num ";
$row = sql_fetch($one_count_sql);
$total_count = $row[cnt];
$total_page = ceil($total_count / $one_rows); // 전체 페이지 계산
if ($page == "") { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $one_rows; // 시작 열을 구함
{
$m_cnt = sql_fetch("SELECT count(*) as cnt from g4_write_xxx where wr_is_comment = 0 order by wr_num ");
if ($m_cnt[cnt] == 0) {
echo $curL = "nodata";
}else{
$query="SELECT * from g4_write_xxx where wr_is_comment = 0 order by wr_num limit $from_record, $one_rows";
$result=mysql_query($query,$connect);
for($i=0; $m = sql_fetch_array($result); $i++) {
//파일이미지 불러오기
$query4="SELECT * from g4_board_file where bo_table = 'g4_write_xxx' and wr_id = '$m[wr_id]' order by bf_no limit 1, 1";
$result4=mysql_query($query4,$connect);
while( $row5=mysql_fetch_array($result4)) {
echo "<img src='$row5[bf_file]' width='150' height='100' border=0' style='border:1 solid #dadada'>";
}
echo $m[wr_id];
$wr_subject = explode(',',$m[wr_subject]);
$subject = $wr_subject[0];
$ex6_filed = explode("|",$m[wr_6]);
$ex7_filed = explode("|",$m[wr_7]);
$address= $ex7_filed[2].$ex7_filed[3];
$phone = $ex6_filed[0]."-".$ex6_filed[1]."-".$ex6_filed[2];
$curL = $subject.";".$phone.";".$address.";".$total_count."\n";
echo($curL);
}
}
}
?>
머가 잘못되었는지 고수님들 부탁좀 드릴게요
<?
$g4_path = "./";
include_once("$g4_path/common.php");
$connect = mysql_connect("localhost","xxxxxx","xxxxx") or die("접속불가");
mysql_select_db("xxxxx");
if(!$options) $options=3;
$cols = $options; // 이미지 가로갯수 // 이미지 세로 갯수는 메인에서 지정(총 이미지 수)
$image_h = 12; // 이미지 상하 간격
$col_width = (int)(99 / $cols);
$data_path = $g4[path]."/data/file/xxx";
//$thumb_path = $data_path.'/thumb';
$thumb_path = $data_path.'/latest_thumb';
$one_rows = "10"; // 출력수량
$one_count_sql = " select count(*) as cnt from g4_write_xxx where wr_is_comment = 0 order by wr_num ";
$row = sql_fetch($one_count_sql);
$total_count = $row[cnt];
$total_page = ceil($total_count / $one_rows); // 전체 페이지 계산
if ($page == "") { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $one_rows; // 시작 열을 구함
{
$m_cnt = sql_fetch("SELECT count(*) as cnt from g4_write_xxx where wr_is_comment = 0 order by wr_num ");
if ($m_cnt[cnt] == 0) {
echo $curL = "nodata";
}else{
$query="SELECT * from g4_write_xxx where wr_is_comment = 0 order by wr_num limit $from_record, $one_rows";
$result=mysql_query($query,$connect);
for($i=0; $m = sql_fetch_array($result); $i++) {
//파일이미지 불러오기
$query4="SELECT * from g4_board_file where bo_table = 'g4_write_xxx' and wr_id = '$m[wr_id]' order by bf_no limit 1, 1";
$result4=mysql_query($query4,$connect);
while( $row5=mysql_fetch_array($result4)) {
echo "<img src='$row5[bf_file]' width='150' height='100' border=0' style='border:1 solid #dadada'>";
}
echo $m[wr_id];
$wr_subject = explode(',',$m[wr_subject]);
$subject = $wr_subject[0];
$ex6_filed = explode("|",$m[wr_6]);
$ex7_filed = explode("|",$m[wr_7]);
$address= $ex7_filed[2].$ex7_filed[3];
$phone = $ex6_filed[0]."-".$ex6_filed[1]."-".$ex6_filed[2];
$curL = $subject.";".$phone.";".$address.";".$total_count."\n";
echo($curL);
}
}
}
?>
댓글 전체
이미지 경로는 만들기만 해놓고 써먹지를 않는군요
echo "<img src='$data_path/$row5[bf_file]'................
echo "<img src='$data_path/$row5[bf_file]'................
정답은 아니였지만 어쨌듯 해결했어요 답변해주셔서 감사해요