数据
/*
Name: ToExcel
Author: Riyao Chen
Version: 0.0.1
Date: 2006-05-15
License: GPL
*/
/****************************************
//This class is to change data from query to excel file
//SQL FORMAT:
SELECT c_id,c_title,c_subject FROM news_content WHERE c_parid=0 ORDER BY c_date desc,c_clicks desc
//The DataBase connection is open outside;
//Parameter:$sql,The query sentence ;$database,which database
***********************************/
class ToExcel
{
var $sql="";
var $fields;
var $db;
function ToExcel($sql,$database)
{
if($sql == "")
return $this->errorMessage("NO QUERY SENTENCE!");
$this->db = $database;
//Get Table Name
$tmp=ereg_replace("SELECT.+FROM ","",$sql);
$tmp=ereg_replace("ORDER BY.+","",$tmp);
$this->table = ereg_replace(" WHERE.+","",$tmp);
//Get Fields
$field = ereg_replace("SELECT ","",$sql);
$field = ereg_replace(" FROM.+","",$field);
if(trim($field) == "*")
$this->fields = $this->GetFieldList($this->table);//$mysql->GetFieldList($this->table);
else
$this->fields = explode(",",$field);
$this->sql = $sql;
}
function ShowExcel()
{
header("Content-type:application/vnd.ms-excel");
header("Content-Disposition:filename=Excel.xls");
//OutPut Fields Start
foreach($this->fields as $key=>$value)
{
echo $value."\t";
}
echo "\n";
//OutPut Fields End
//OutPut Field Value Start
$result = mysql_query($this->sql);
while($row = mysql_fetch_array($result))
{
foreach($this->fields as $key=>$value)
echo iconv("utf-8","gb2312",$row[$value]."\t");
echo "\n";
}
//OutPut Field Value End
}
//Get The FieldLis
function GetFieldList($table)
{
if($result=mysql_list_fields($this->db,$table)){
$i=0;
while($i $fd_names[$i]=mysql_field_name($result,$i);
$i++;
}
return($fd_names);
}else
return $this->errorMessage("Unable to find any field list in table: $tbl_name");
}
function errorMessage($msg){
echo "Error: $msg : ".mysql_error();
return false;
}
}
/*
exemple
$sql = "SELECT * FROM news_content WHERE c_parid=0 ORDER BY c_date desc,c_clicks desc";
$excel = new ToExcel($sql,DATABASE_NAME);
$excel->ShowExcel();
*/
?>

핫 AI 도구

Undresser.AI Undress
사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover
사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool
무료로 이미지를 벗다

Clothoff.io
AI 옷 제거제

AI Hentai Generator
AI Hentai를 무료로 생성하십시오.

인기 기사

뜨거운 도구

MinGW - Windows용 미니멀리스트 GNU
이 프로젝트는 osdn.net/projects/mingw로 마이그레이션되는 중입니다. 계속해서 그곳에서 우리를 팔로우할 수 있습니다. MinGW: GCC(GNU Compiler Collection)의 기본 Windows 포트로, 기본 Windows 애플리케이션을 구축하기 위한 무료 배포 가능 가져오기 라이브러리 및 헤더 파일로 C99 기능을 지원하는 MSVC 런타임에 대한 확장이 포함되어 있습니다. 모든 MinGW 소프트웨어는 64비트 Windows 플랫폼에서 실행될 수 있습니다.

SublimeText3 Linux 새 버전
SublimeText3 Linux 최신 버전

DVWA
DVWA(Damn Vulnerable Web App)는 매우 취약한 PHP/MySQL 웹 애플리케이션입니다. 주요 목표는 보안 전문가가 법적 환경에서 자신의 기술과 도구를 테스트하고, 웹 개발자가 웹 응용 프로그램 보안 프로세스를 더 잘 이해할 수 있도록 돕고, 교사/학생이 교실 환경 웹 응용 프로그램에서 가르치고 배울 수 있도록 돕는 것입니다. 보안. DVWA의 목표는 다양한 난이도의 간단하고 간단한 인터페이스를 통해 가장 일반적인 웹 취약점 중 일부를 연습하는 것입니다. 이 소프트웨어는

Atom Editor Mac 버전 다운로드
가장 인기 있는 오픈 소스 편집기

안전한 시험 브라우저
안전한 시험 브라우저는 온라인 시험을 안전하게 치르기 위한 보안 브라우저 환경입니다. 이 소프트웨어는 모든 컴퓨터를 안전한 워크스테이션으로 바꿔줍니다. 이는 모든 유틸리티에 대한 액세스를 제어하고 학생들이 승인되지 않은 리소스를 사용하는 것을 방지합니다.
