核心就是这一句
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());