엑셀다운 실행시 500에러가 떠요 쿼리문에 문제가 있는지 도와주세요

2021-07-21 (수) 21:02:42 3,650
Copy
<?php
include_once('./_common.php');
   /*================================================================================
    php_writeexcel http://www.bettina-attack.de/jonny/view.php/projects/php_writeexcel/
    =================================================================================*/
    include_once(G5_LIB_PATH.'/Excel/php_writeexcel/class.writeexcel_workbook.inc.php');
    include_once(G5_LIB_PATH.'/Excel/php_writeexcel/class.writeexcel_worksheet.inc.php');

$sql_order = " order by wr_num, wr_reply "; 
  if ($sca || $stx) 
  { 
    $sql = " select distinct wr_parent from $write_table where $sql_search $sql_order "; 
  } 
  else 
  { 
    $sql = " select * from $write_table where wr_is_comment = 0 $sql_order "; 
  } 

    $result = sql_query($sql); 
    //$result = iconv("utf-8", "euc-kr" , $result); 
    $cnt = @mysql_num_rows($result); 
    if (!$cnt) 
        alert("출력할 내역이 없습니다."); 
    header('Content-Type: application/vnd.ms-excel'); 
    header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT'); 
    header('Content-Disposition: attachment; filename="WAofficelist_' . date("ymd_his", time()) . '.xls"'); 
    header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); 
    header('Pragma: public'); 
    header('content-transfer-encoding: binary');

답변 2개

2021-07-22 (목) 01:43:53

https://sir.kr/qa/?wr_id=405998

일단 구체적인 에러 메시지를 확인하세요.

2021-07-21 (수) 21:31:24

$sql_search 이게 어딧나요? 

아님 echo $sql로 보세요 몇가지 주석처리하시고 

답변을 작성하려면 로그인이 필요합니다.