自动生成excel格式文件
时间:2007-02-17 来源:PHP爱好者
<?
header("Content-type:application/vnd.ms-excel");
header("Content-Disposition:filename=test.xls");
echo "编 号t";
echo "公司名称t";
echo "房 间 号t";
echo "入驻日期t";
echo "联 系 人t";
echo "联系电话";
include("include/global.php");
$sql = "select id,company,roomid,indate,telephone,contanctman from company_info";
$db->query($sql);
$i = 0;
while($db->records())
{
echo "n";
echo $db->get('id');
echo "t";
echo $db->get('company');
echo "t";
echo $db->get('roomid');
echo "t";
echo $db->get('indate');
echo "t";
echo $db->get('contanctman');
echo "t";
echo $db->get('telephone');
}
$i++;
?>
php爱好 者站 http://www.phpfans.net php基础|php进阶|php模板.
相关阅读 更多 +