ob_start();
define("FILETYPE","xls");
header("Content-type:application/vnd.ms-excel");
if(FILETYPE=="xls")
header("Content-Disposition:filename=report.xls");
else
header("Content-Disposition:filename=report.csv");
echo "书名\t作者\t出版日期\t价格\n";
$chick_sql = $_GET["ss"];
#echo $chick_sql." ";
$chick_sql = str_replace("\'", "", $chick_sql);
$result = mysql_query($chick_sql,$con);
$num_rows = mysql_num_rows($result);
while($row = mysql_fetch_array($result)){
echo "《".$row["bname"]."》\t".$row["booker"]."\t".$row["bookcbrq"]."\t¥".$row["bmoney"]."元\n";
}
|