您的位置:首页 > 编程语言 > PHP开发

mysql导出到excel xls,利用php脚本

2016-11-19 17:50 323 查看
核心就是这一句

select * from 会员表等 into outfile  'd:/文件名123.xls';

convert可以防止乱码.
以下用法只是一个实例,仅供参考,他可以放在你的网站首页或其它页面的控制器中,然后直接打开那个页面就可以生成了.

$this->db->GetList("select convert(username using gb2312),mobile from `@#_member` where mobile >0 into outfile 'd:/3.xls'");die(mysql_error());
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: