怎么导出网站的注册会员邮箱呢

2016-07-07 16:02 来源:www.chinab4c.com 作者:ecshop专家

怎么导出网站的注册会员邮箱呢,求助哦

回答:
在线求助

找到这段代码,怎么用呢

ob_start();
/* 初始化压缩类 */
include_once('includes/cls_phpzip.php');
$zip = new PHPZip;

$where = ' where 1 ' ;
/* 获取用户邮箱 */
$sql = "select user_name,email from ".$ecs->table('users')."$where";
$res = $db->query($sql);

/* CSV 格式文件 */
$email_value = array();
$content = "username,email\n";
while ($row = $db->fetchRow($res))
{
$email_value['username'] =$row['user_name'];
$email_value['email'] =$row['email'];
$content .= implode(",", $email_value) . "\n";
}

$zip->add_file(ecs_iconv(EC_CHARSET, 'GB2312', $content),'mail_list.csv');
header("Content-Disposition: attachment; filename=mail_list.zip");
header("Content-Type: application/unknown");
ob_end_flush();
die($zip->file());

斑竹在么

从数据库直接导出吗,就一个简单的查询语句啊

楼主是想导出到EXCEL文件中吧

路过!学习,看看!刷个分!

路过!学习,看看!刷个分!

随便看看,搞个积分,

路过!学习,看看!刷个分!