All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
ASP.NET中自定义提示对话框_[Asp.Net教程]
SQL细节知识积累_[SQL,Server教程]
PHP自带可以代替echo调试的unit函数_php资料_编程技术
PHP学习宝典-第二章_[PHP教程]
PHP技巧:动态网页技术PHP程序字符串处理函数_[PHP教程]
ASP.NET技巧:同时对多个文件进行大量写操作对性能优化_[Asp.Net教程]
PHP应用技巧小总结:几个有用的小技巧_php资料_编程技术
2种删除SQL SERVER数据库日志方法_[SQL Server教程]
Sql,server动态建立数据对象结构_[SQL,Server教程]
在C#中调用存储过程
Reading number is top 10 pictures
From China fortress sora aoi4
Fierce chengdu woman, street rape man
NeedWallpaper6
这酸爽,让人不敢相信
9.3阅兵全景图7-指挥系统和后勤保障系统梯队
看到这名字我也是醉了。。。。。。
这才叫绝色美女1
网络游戏与脑残
中国女孩大胆自拍,显露完美身材4
星星命名法则
Download software ranking
双旗镇刀客A
都市狐狸姑娘传
Unix video tutorial11
Take off clothes to survival
Sora aoi‘s film--Lust fan wall
Ashlynn Video1
天龙八部最新服务端
Boxer vs Yellow2
Tram sex maniac 2 (H) rar bag8
C#与.NET技术平台实战演练
归海一刀 published in(发表于) 2014/2/17 7:33:29 Edit(编辑)
PHP实例:用PHP将mysql数据表转换为excel文件格式_[PHP教程]

PHP实例:用PHP将mysql数据表转换为excel文件格式_[PHP教程]

PHP实例:用PHP将mysql数据表转换为excel文件格式_[PHP教程]

作者:mydowns 出处:把握时间网站:http://www.85time.com, http://www.mydowns.com
原贴地址如下:
http://www.mydowns.com/article_show.php?id=32

详细内容如下:
DB_Server = "localhost";
DB_Username = "mydowns";
DB_Password = "";
DB_DBName = "mydowns";
DB_TBLName = "user";
Connect = @mysql_connect(DB_Server, DB_Username, DB_Password)
or die("Couldn't connect.");
Db = @mysql_select_db(DB_DBName, Connect)
or die("Couldn't select database.");
file_type = "vnd.ms-excel";
file_ending = "xls";
header("Content-Type: application/file_type");
header("Content-Disposition: attachment; filename=mydowns.file_ending");
header("Pragma: no-cache");
header("Expires: 0");
now_date = date('Y-m-d H:i');
title = "数据库名:DB_DBName,数据表:DB_TBLName,备份日期:now_date";
sql = "Select * from DB_TBLName";
ALT_Db = @mysql_select_db(DB_DBName, Connect)
or die("Couldn't select database");
result = @mysql_query(sql,Connect)
or die(mysql_error());
echo("title\n");
sep = "\t";
for (i = 0; i < mysql_num_fields(result); i ) {
echo mysql_field_name(result,i) . "\t";
}
print("\n");
i = 0;
while(row = mysql_fetch_row(result))
{
schema_insert = "";
for(j=0; j{
if(!isset(row[j]))
schema_insert .= "NULL".sep;
elseif (row[j] != "")
schema_insert .= "row[j]".sep;
else
schema_insert .= "".sep;
}
schema_insert = str_replace(sep."", "", schema_insert);
schema_insert .= "\t";
print(trim(schema_insert));
print "\n";
i ;
}
return (true);
?>






添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.