확장 여분필드 엑셀 출력 문의

· 2011-08-09 (화) 10:10:09 · 1716 · 2
다른값들은 엑셀 출력이 전혀 문제가 없는데
여분필드를 쪼개서 확장여분필드로 쓴 경우에 따로 항목을 엑셀로 뽑아야 하는데
아예 빈값으로만 저장됩니다.
사용한 코드는 아래와 같습니다.
어디가 잘못된건지 당췌 모르겠네요.

사용한 여분필드--------------------------------------------------------------

$ex6_filed = explode("|",$view[wr_6]);
$ext6_00 = $ex6_filed[0];
$ext6_01 = $ex6_filed[1];
$ext6_02 = $ex6_filed[2];
$ext6_03 = $ex6_filed[3];
$ext6_04 = $ex6_filed[4];
$ext6_05 = $ex6_filed[5];
$ext6_06 = $ex6_filed[6];
$ext6_07 = $ex6_filed[7];
$ext6_08 = $ex6_filed[8];
$ext6_09 = $ex6_filed[9];

excel.php -----------------------------------------------------------------------------

<?
$excel_down = "g4_write_" . $_GET['bo_table']; //엑셀 다운로드 테이블
$wr_id = $id = $_GET['wr_id'];

$ex_data = explode("|",$row[wr_6]);

include "../../../dbconfig.php";
$db_conn = mysql_connect($mysql_host, $mysql_user, $mysql_password) or die('서버에 접속하지 못했습니다.');
mysql_select_db($mysql_db, $db_conn);
//@mysql_query("SET CHARACTER SET utf8"); // 한글깨지면 주석해지

$today = date("Y-m-d");
header( "Content-type: application/vnd.ms-excel" );
header( "Content-Disposition: attachment; filename=다운로드_". $today. ".xls");
header( "Content-Description: PHP4 Generated Data" );

$temp=mysql_fetch_array(mysql_query("select count(*) from $excel_down ")); //where wr_is_comment = '0' and wr_content = '$wr_id' "));
$result=@mysql_query("select * from $excel_down order by wr_datetime desc");// where wr_is_comment = '0' and wr_content = '$wr_id' order by wr_datetime desc");

$number=$temp[0];
?>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<style type="text/css">
.txt {mso-number-format:'\@'}
</style>
</head>

<body>
<table>

<?
while($data=mysql_fetch_array($result)) {
echo "

<tr>
<td>$number</td>
<td class='txt'>$data[wr_datetime]</td>
<td>$data[wr_subject]</td>
<td>$data[wr_name]</td>
<td class='txt'>$ex_data[1]</td>
<td class='txt'>$ex_data[2]</td>
<td class='txt'>$ex_data[5]</td>
<td class='txt'>$ex_data[8]</td>
<td class='txt'>$ex_data[9]</td>
</tr>
";

$number--;
}
?>

</table>
</body>
</html>
|

댓글 2개

while($data=mysql_fetch_array($result)) {
$ex_data = explode("|",$data[wr_6]);///추가
ech "....
이렇게 되야 하지 않나요?
정말 감사합니다.
덕분에 바로 해결되서 햄볶고 있습니다.
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

66,531건

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

+
제목 글쓴이 날짜 조회
11-08-09 조회 1,162
11-08-09 조회 1,474
11-08-09 조회 930
11-08-09 조회 1,115
11-08-09 조회 1,717
11-08-09 조회 2,128
11-08-09 조회 1,117
11-08-09 조회 1,642
11-08-09 조회 1,076
11-08-08 조회 1,061
11-08-08 조회 1,733
11-08-08 조회 1,900
11-08-08 조회 2,046
11-08-08 조회 908
11-08-08 조회 1,278
11-08-08 조회 1,077
11-08-08 조회 1,675
11-08-08 조회 1,233
11-08-08 조회 3,748
11-08-08 조회 1,644