게시글 엑셀다운로드시 오류가납니다.

게시글 엑셀다운로드시 오류가납니다.

QA

게시글 엑셀다운로드시 오류가납니다.

본문


<?
	include_once("./_common.php");
 
	if($is_admin == 'super'){
 
 
		$excel_down = "g5_write_" . $_POST['bo_table']; //엑셀 다운로드 테이블
		$wr_id = $id = $_GET['wr_id']; 
 
		//@mysql_query("SET CHARACTER SET utf8");  // 한글깨지면 주석해지
 
		$g5[title] = "엑셀 문서 다운로드"; 
		header( "Content-type: application/vnd.ms-excel" ); 
		header( "Content-Disposition: attachment; filename=".date("ymdH")."-참가목록.xls" ); 
		header( "Content-Description: PHP4 Generated Data" ); 
 
 
 
		$temp=mysql_fetch_array(mysql_query("select count(*) from $excel_down ")); 
		$result=@mysql_query("select * from $excel_down 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 border="1"> 
  <tr height="50">
    <td colspan="13" style="font-size:20px; color:#ffffff; background:#666666;">참가신청 리스트</td>
  </tr>
  <tr>
    <td>번호</td>
    <td>참가분야</td>
    <td>참가구분</td>
    <td>참가자(대표자)성명</td>
    <td>생년월일</td>
	<td>소속</td>
    <td>휴대폰</td>
    <td>이메일</td>
	<td>주소</td>
	<td>참가 인원</td>
	<td>팀명</td>
	<td>작품명</td>
    <td>출품날짜</td>
  </tr>
 
<? 
while($data=mysql_fetch_array($result)) { 
 
//대표자정보
$representative = explode("|",$data[wr_3]);
$birth = $representative[0];
$belong = $representative[1];
$hp = $representative[2];
 
//주소
$address = explode("|",$data[wr_4]);
$zip = $address[0];
$addr1 = $address[1];
$addr2 = $address[2];
$addr3 = $address[3];
$jibeon = $address[4];
 
//팀정보
$teamA = explode("|",$data[wr_5]);
$team_persons = $teamA[0];
$team_name = $teamA[1];
 
//공동참가자
$teamB = explode("|",$data[wr_6]);
$team_detail01 = $teamB[0];
$team_detail02 = $teamB[1];
$team_detail03 = $teamB[2];
$team_detail04 = $teamB[3];
$team_detail05 = $teamB[4];
$team_detail06 = $teamB[5];
$team_detail07 = $teamB[6];
$team_detail08 = $teamB[7];
 
echo "
  <tr> 
	<td class='txt'>$number</td>
    <td class='txt'>".$data[ca_name]."</td>
	<td class='txt'>".$data[wr_2]."</td>
	<td class='txt'>".$data[wr_name]."</td>
    <td class='txt'>".$data[wr_email]."</td>
    <td class='txt'>".$data[wr_1]."</td>
    <td class='txt'>".$birth."</td>
    <td class='txt'>".$data[wr_5]."</td>
	<td class='txt'>".$data[wr_4]."</td>
	<td class='txt'>".$data[wr_6]."</td>
	<td class='txt'>".$data[wr_7]."</td>
	<td class='txt'>".$data[wr_8]."</td>
    <td class='txt'>$data[wr_datetime]</td>
  </tr>
";
		$number--; 
	} 
?>
</table> 
</body> 
</html>
 
<?
 
	}
 
?>

 

기존소스를 위와같이 수정해서 적용했는데..엑셀파일 열면 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in 도메인 on line 57 에러가 납니다.

 

어디가 잘못된걸까요..??

 

미리 감사드리며 도움요청드립니다.

이 질문에 댓글 쓰기 :

답변 1

@mysql_fetch_array() 처럼 골뱅이를 붙여 보세요.

답변을 작성하시기 전에 로그인 해주세요.
전체 59,580
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT