PHP MySQL 데이타를 MS Excel화일로 변환 > PHP

STUDY ROOM

PHP

PHP MySQL 데이타를 MS Excel화일로 변환

페이지 정보

작성자 JMStudy 작성일05-06-26 01:31 조회10,044회 댓글0건

본문

<?
$date=date("Ymd"); // 화일명중 날짜부분
$filename=$date.".xls";
header( "Content-type: application/vnd.ms- excel;charset=KSC5601" );
header("Content-Disposition: attachment; filename=$filename");
header( "Content-Description: PHP4 Generated Data" );

include "../lib/config.php";
include "../lib/function.php";

// 검색기간 셋팅
$regStart = $sYear.$sMonth.$sDay;
$regEnd = $eYear.$eMonth.$eDay;

$numresults_qry = "select t1.idx, t1.ordercode, t1.writeday, t1.payM, t1.tel, t1. payMethod, t1.userid_part, t1.name, t1.rname,t1.rzip,t1.rtel,t1.radr1,t1.radr2,t1.rhand,t1.content,t2.price, t2.status,t2.cnt,t2.g_id from order_info t1 left join order_goods t2 on t1.ordercode=t2.ordercode where substring(t2.ordercode,4,6)>=$regStart and substring(t2.ordercode,4,6)<=$regEnd";

$numrows=DBaffected($numresults_qry); //총 레코드수..
$bbs_qry = $numresults_qry." order by t1.idx desc";
$bbs_result=DBquery($bbs_qry);

echo "
주문번호고객명전화번호1전화번호2주소배송전달사항품명내품수량택배임운송장번호
');
echo $bbs_row[ordercode];
echo ('
');
echo $bbs_row[rname];
echo ('
');
echo $bbs_row[rtel];
echo ('
');
echo $bbs_row[rhand];
echo ('
');
echo $bbs_row[radr1].$bbs_row[radr2];
echo ('
');
echo $bbs_row[content];
echo ('
');
echo "";
echo ('
');
echo "";
echo ('
');
echo "";
echo ('
');
echo "";
echo ('
');
?>
댓글목록

등록된 댓글이 없습니다.