그누4에서 그누5로 넘어오면서 잘되던 소스가 안되네요 ㅠㅠ
본문
그누4에서 잘되던 댓글 엑셀다운받는 소스인데요
그누5에서는 내용이 넘어오질 않습니다..
벌써 한달째 매달리고 있는데...이거 소스중에 빨간색표시 MySql 코딩에서 문제가 있는거 같은데요..
제 능력에서는 도저히 답이 안보이네요 ㅠㅠ
<?
include_once("./_common.php");
$wr_id = $_GET['wr_id']; // 넘어온 값 (게시글 id)
$bo_t = $_GET['bo_t']; // 넘어온 값 (테이블명)
$excel_down = "g5_write_".$bo_t; // 엑셀 다운로드 테이블 설정
$g4[title] = "엑셀 문서 다운로드";
header( "Content-type: application/vnd.ms-excel" );
header( "Content-Disposition: attachment; filename=exam_list.xls" );
header( "Content-Description: PHP4 Generated Data" );
$result=@mysql_query("select'>$result=@mysql_query("select * from $excel_down where wr_is_comment = '1' and wr_parent = '$wr_id' order by wr_datetime asc"); // <-이부분이 문제인듯 합니다...ㅜㅜ
?>
<html>
<head>
<title><?=$g4[title]?></title>
</head>
<body>
<table width=100% cellpadding=0 cellspacing=0 border=1>
<tr align=center height=30>
<td style=font-weight:bold;>번호</td>
<td style=font-weight:bold;>성명</td>
<td style=font-weight:bold;>성별</td>
<td style=font-weight:bold;>신청일</td>
<td style=font-weight:bold;>전화번호</td>
<td style=font-weight:bold;>휴대폰</td>
<td style=font-weight:bold;>직업</td>
<td style=font-weight:bold;>생년월일</td>
<td style=font-weight:bold;>이메일</td>
<td style=font-weight:bold;>우편번호</td>
<td style=font-weight:bold;>주소</td>
</tr>
<?
$i = 0;
while($data=mysql_fetch_array($result1)) {
$i++;
// tmp: 0.생년월일, 1.성별, 2.직업, 3.이메일, 4.전화번호, 5.휴대폰, 6.우편번호1, 7.우편번호2, 8.주소1 9.주소2
$tmp = explode("|",$data[wr_1]);
// 날짜에 월,일 구분 "-" 넣기
$tmp_date = substr($tmp[0],0,4).-substr($tmp[0],4,2).-substr($tmp[0],6,2);
echo"
<tr height=25>
<td>$i</td>
<td>$data[wr_name]</td>
<td>$tmp[1]</td>
<td>$data[wr_datetime]</td>
<td>$tmp[4]</td>
<td>$tmp[5]</td>
<td>$tmp[2]</td>
<td>$tmp_date</td>
<td>$tmp[3]</td>
<td>$tmp[6]-$tmp[7]</td>
<td>$tmp[8] $tmp[9]</td>
</tr>";
}
?>
</table>
</body>
</html>
답변 2
아래처럼 바꿔보세요.
mysql_query --> sql_query
mysql_fetch_array -->
sql_fetch_array
@mysql_query("select * from $excel_down where wr_is_comment = '1' and wr_parent = '$wr_id' order by wr_datetime asc");
// 본문 소스 이건데....이상하게 들어가있네요...혹시 다른분들 헷갈리실까바 써놓습니다.
sinbi님 답변처럼 바꾸니까 바로 해결 됬습니다~