멤버 엑셀로 다운로드시 누락되는 현상
본문
회원이 4천여명 되는데 2천명정도만 엑셀로 저장이 됩니다.
아이디 a~i는 엑셀로 저장이 안되고 j~z한글아이디까지만 저장이 됩니다.
어떤 문제가 있는건지요? 도움 부탁 드립니다.
답변 3
어떤 Excel 라이브러리를 이용하셨나요
Memory, execution time 부족 등이 예상 되네요.
정확한 것은 소스를 봐야합니다.
<?
include_once("./_common.php");
if (!$is_admin =="super"){
alert_close("최고 관리자 영역 입니다.");
}
/* 만든이 : 헐랭이 / http://avaschool.net / *** 개인정보보호를 위한 이메일주소 노출방지 *** */
?>
<?
if ($sv =="yes") {
if ($ms =="excel"){
$g5[title] = "엑셀 문서 다운로드";
header( "Content-type: application/vnd.ms-excel" );
header( "Content-Disposition: attachment; filename=g5_member.xls" );
} else {
$g5[title] = "엑셀 문서 다운로드";
header( "Content-type: application/vnd.ms-excel" );
header( "Content-Disposition: attachment; filename=g5_member.xls" );
}
header( "Content-Description: PHP Generated Data" );
// 다운로드 모드에서의 넘어온 값에 대한처리
if($code =="1"){
$m_que = "$g5[member_table] order by mb_id desc";
}else if($code =="2"){
$m_que = "$g5[member_table] order by mb_id asc";
}else if($code =="3"){
$m_que = "$g5[member_table] order by mb_level desc";
}else if($code =="4"){
$m_que = "$g5[member_table] order by mb_level asc";
}else if($code =="5"){
$m_que = "$g5[member_table] order by mb_point desc";
}else if($code =="6"){
$m_que = "$g5[member_table] order by mb_point asc";
}else if($code =="7"){
$m_que = "$g5[member_table] order by mb_datetime desc";
}else if($code =="8"){
$m_que = "$g5[member_table] order by mb_datetime asc";
}else if($code =="9"){
if (!$name) {
$m_que = "$g5[member_table] order by mb_level desc";
} else {
$m_que = "$g5[member_table] where mb_level ='$name'";
}
}else if($code =="10"){
if (!$name) {
$m_que = "$g5[member_table] order by mb_level asc";
} else {
$m_que = "$g5[member_table] where mb_level <= $name";
}
}else if($code =="11"){
if (!$name) {
$m_que = "$g5[member_table] order by mb_level desc";
} else {
$m_que = "$g5[member_table] where mb_level >= $name";
}
}else if($code =="12"){
$m_que = "$g5[member_table] order by mb_today_login desc";
}else if($code =="13"){
$m_que = "$g5[member_table] order by mb_today_login asc";
}else if($code =="14"){
$m_que = "$g5[member_table] order by mb_1_date desc";
}else if($code =="15"){
$m_que = "$g5[member_table] order by mb_1_date asc";
}else if($code =="16"){
$m_que = "$g5[member_table] where mb_sex ='M'";
}else if($code =="17"){
$m_que = "$g5[member_table] where mb_sex ='F'";
}else if($code =="18"){
$m_que = "$g5[member_table] order by mb_birth desc";
}else if($code =="19"){
$m_que = "$g5[member_table] order by mb_birth asc";
}else if($code =="20"){
$m_que = "$g5[member_table] where mb_mailling ='1'";
}else if($code =="21"){
$m_que = "$g5[member_table] where mb_mailling ='0'";
}else if($code =="22"){
$m_que = "$g5[member_table] where mb_sms ='1'";
}else if($code =="23"){
$m_que = "$g5[member_table] where mb_sms ='0'";
}else if($code =="24"){
$m_que = "$g5[member_table] where mb_open ='1'";
}else if($code =="25"){
$m_que = "$g5[member_table] where mb_open ='0'";
}else if($code =="26"){
$m_que = "$g5[member_table] where mb_id like '%$name%'";
}else if($code =="27"){
$m_que = "$g5[member_table] where mb_name like '%$name%'";
}else if($code =="28"){
$m_que = "$g5[member_table] where mb_1 like '%$name%'";
} else {
$m_que = "$g5[member_table] order by mb_id desc";
}
$result = mysql_query("select * from $m_que");
$temp = mysql_fetch_array(mysql_query("select count(*) from $g5[member_table] $m_que"));
$number=$temp[0]
?>
<html>
<head>
<title><?=$g5[title]?> -페이지-</title>
<meta http-equiv="Content-Type" content="text/html; charset=<?=$ks?>">
<style type="text/css">
.txt {mso-number-format:'\@'}
</style>
</head>
<body>
<table width=100% cellpadding=0 cellspacing=0 border=1>
<tr align=center height=25 bgcolor=999999>
<td style=font-weight:bold;>no</td>
<td style=font-weight:bold;>id</td>
<td style=font-weight:bold;>name</td>
<td style=font-weight:bold;>belong</td>
<td style=font-weight:bold;>level</td>
<td style=font-weight:bold;>join</td>
<td style=font-weight:bold;>email</td>
<td style=font-weight:bold;>tel</td>
<td style=font-weight:bold;>HP</td>
<td style=font-weight:bold;>add</td>
</tr>
<?
while($data=mysql_fetch_array($result))
{
if ($data[mb_sex] =="M") { $mb_sex ="남자"; } else if ($data[mb_sex] =="F"){ $mb_sex ="여자"; }
if ($data[mb_mailling] =="1") { $mb_mailling ="받음"; } else if ($data[mb_mailling] =="0"){ $mb_mailling ="안받음"; }
if ($data[mb_sms] =="1") { $mb_sms ="받음"; } else if ($data[mb_sms] =="0"){ $mb_sms ="안받음"; }
if ($data[mb_open] =="1") { $mb_open ="공개"; } else if ($data[mb_open] =="0"){ $mb_open ="비공개"; }
echo"
<tr align=center height=24>
<td>$number</td>
<td>$data[mb_id]</td>
<td>$data[mb_name]</td>
<td>$data[mb_1]</td>
<td>$data[mb_level]</td>
<td>$data[mb_nick_date]</td>
<td>$data[mb_email]</td>
<td>$data[mb_tel]</td>
<td class=txt>$data[mb_hp]</td>
<td>$data[mb_addr1]</td>
</tr>
";
$number--;
}
echo "
</table>
</body>
</html>
헤더구간에서 엑셀로 표기한느 걸 빼놓고 출력해서 쿼리문하고 내용비교 해보셔야 할 듯 해요
코드상에서는 논리적 오류를 잘 모르겠어요