PHP mysql列表在线导出excel文件
来源:互联网 发布:flashfxp for mac 编辑:程序博客网 时间:2024/05/22 20:51
<?phprequire_once '../../config.inc.php'; //数据库配置文件$filename=date("Y-m-d H:i:s").".xls";//先定义一个excel文件header("Content-Type: application/vnd.ms-execl"); header("Content-Type: application/vnd.ms-excel; charset=utf-8");header("Content-Disposition: attachment; filename=$filename"); header("Pragma: no-cache"); header("Expires: 0"); // END 配置 //链接数据库 $link = mysql_connect($dbhost,$dbuser,$dbpw); mysql_select_db($dbname); //选择编码 mysql_query("set names ".$charset);//我们先在excel输出表头,当然这不是必须的echo iconv("utf-8", "gb2312", "编号")."\t";echo iconv("utf-8", "gb2312", "关键词")."\t";echo iconv("utf-8", "gb2312", "来源")."\t";echo iconv("utf-8", "gb2312", "添加时间")."\t";echo iconv("utf-8", "gb2312", "IP地址")."\t";echo iconv("utf-8", "gb2312", "归属地")."\t";echo iconv("utf-8", "gb2312", "客户端")."\n";//输出表中记录$btime = $_POST['btime'];$etime = $_POST['etime'];if(!empty($btime) && !empty($etime)){ $b_time = strtotime($btime); $e_time = strtotime($etime); $where = " where addtime between $b_time and $e_time ";}else{ $where = '';}$query=mysql_query("SELECT * FROM `chat_talk` ".$where." order by `tid` desc");if($query){ while($row=mysql_fetch_array($query)){ echo iconv("utf-8", "gb2312", $row['tid'])."\t"; echo iconv("utf-8", "gb2312", $row['keyword'])."\t"; echo iconv("utf-8", "gb2312", $sorce)."\t"; echo iconv("utf-8", "gb2312", date('Y-m-d H:i:s', $row['addtime']))."\t"; echo iconv("utf-8", "gb2312", $row['ip'])."\t"; echo iconv("utf-8", "gb2312", $row['area'])."\t"; echo iconv("utf-8", "gb2312", $row['display'])."\n"; } }?>
0 0
- PHP mysql列表在线导出excel文件
- PHP导出MySQL数据到Excel文件
- PHP导出MySQL数据到Excel文件
- PHP导出MySQL数据到Excel文件
- PHP导出MySQL数据到Excel文件
- PHP导出MySQL数据到Excel文件
- PHP导出MySQL数据到Excel文件
- PHP导出MySQL数据到Excel文件
- PHP导出MySQL数据到Excel文件
- PHP导出MySQL数据到Excel文件
- PHP导出Excel文件
- PHP导出Excel文件
- php 导出EXCEL文件
- php导出Excel文件
- php 导出excel文件
- mysql导出excel文件
- php导出任意mysql数据库中的表去excel文件
- PHP导出MySQL数据到Excel或者CSV文件
- SVG
- 是时候取消Sprint评审会议了吗?
- 编码转换--字符映射表
- 启动nginx报错/usr/local/nginx/sbin/nginx: error while loading shared libraries: libpcre.so.1: cannot ope
- 精细化容量管理的设备成本优化之路
- PHP mysql列表在线导出excel文件
- Location定位信息以及坐标系的转换
- 安装MATLAB2016a的完整步骤
- Spark高级数据分析(1) ——纽约出租车轨迹的空间和时间数据分析
- android 软键盘弹出隐藏挤压界面等有关问题
- CSS 优化、提高性能的方法 汇总
- node
- R+NLP︱text2vec包——BOW词袋模型做监督式情感标注案例(二,情感标注)
- Java分布式应用如何入门以及有哪些资料?