엑셀로 출력할때 순서 변경하는 방법좀 문의드립니다

엑셀로 출력할때 순서 변경하는 방법좀 문의드립니다

QA

엑셀로 출력할때 순서 변경하는 방법좀 문의드립니다

본문

엑셀파일로 출력을 하면 순번1이 맨아래로 가는데요
 
1번부터 나오도록 할려고 하니 db쪽이라 막히네요 흠...
 

<?
$g4_path = "../../.."; 
include_once("$g4_path/common.php"); 
$excel_down = "g4_write_" . $bo_table; 
@mysql_query("SET CHARACTER SET utf8");  // 한글깨지면 주석해지
if ($ms =="excel"){ 
$g4[title] = "excel"; 
  header( "Content-type: application/vnd.ms-excel" ); 
  header( "Content-Disposition: attachment; filename=excel.xls" ); 
  //header( "Content-Description: PHP4 Generated Data" ); 
 } else { 
  header( "Content-type: application/vnd.ms-excel" ); 
  header( "Content-Disposition: attachment; filename=excel.xls" ); 
 } 
  header( "Content-Description: PHP4 Generated Data" ); 

/* 날자지정 출력 가능 (해바리님 소스)
$temp=mysql_fetch_array(mysql_query("select count(*) from $excel_down where left(wr_datetime,10)='$datetime' ")); 
$result=mysql_query("select * from $excel_down where left(wr_datetime,10)='$datetime' "); 
*/
/* 날자지정 출력 가능(단 서버에서만!)
$temp=mysql_fetch_array(mysql_query("select count(*) from $excel_down where left(wr_datetime,10)=curdate() ")); 
$result=mysql_query("select * from $excel_down where left(wr_datetime,10)=curdate() ");
*/
$temp=mysql_fetch_array(mysql_query("select * from table where datetime_col = curdate(); $excel_down ")); 
$result=@mysql_query("select * from $excel_down order by wr_datetime desc");

$number=$temp[0];
?>
 
도움좀 요청드립니다~

이 질문에 댓글 쓰기 :

답변 1

정말 간단한 문의 였네요... ㅎ
 

$temp=mysql_fetch_array(mysql_query("select * from table where datetime_col = curdate(); $excel_down ")); 
$result=@mysql_query("select * from $excel_down order by wr_datetime asc");
 
desc 와 asc에 차이네요 ^^
 
혹시 sql문 관련 참고할 사이트 있으면 알려주세요 ㅠㅠ
답변을 작성하시기 전에 로그인 해주세요.
전체 8
QA 내용 검색

회원로그인

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