질문 & 답변 게시판
접속자 수를 보려고 하면....
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ');/*2008051115362'' at line 1
이런 화면이 뜨구요ㅠㅠㅠㅠㅠㅠㅠㅠ
해당 php파일의 내용은 아래와 같습니다.
<?
// 라이브러리 함수 파일 인크루드
require "lib.php";
// DB 연결
$connect=dbConn();
// 멤버정보 구하기
$member=member_info();
if(!$member[no]) Error("로그인된 회원만이 사용할수 있습니다","window.close");
if(!$page&&!$status) $status=1;
// 그룹데이타 읽어오기;;
$group_data=mysql_fetch_array(mysql_query("select * from $group_table where no='$member[group_no]'"));
// 검색어 처리;;
if($keyword) {
if(!$status) $s_que=" where user_id like '%$keyword%' or name like '%$keyword%' ";
}
// 전체 회원의 수
$temp2=mysql_fetch_array(mysql_query("select count(*) from $member_table $s_que"));
$total_member=$temp2[0];
if($status) {
$_str = trim(zReadFile("data/now_member_connect.php"));
if($_str) {
$_str = str_replace("<?/*","",$_str);
$_str = str_replace("*/?>","",$_str);
$_connector = explode(":",$_str);
$total = count($_connector);
}
} else $total=$total_member;
// 페이지 계산
$page_num=10;
$total_page=(int)(($total-1)/$page_num)+1; // 전체 페이지 구함
if(!$page) $page=1;
if($page>$total_page) $page=1; // 페이지가 전체 페이지보다 크면 페이지 번호 바꿈
$start_num=($page-1)*$page_num; // 페이지 수에 따른 출력시 첫번째가 될 글의 번호 구함
// 데이타 뽑아오는 부분
// 오프라인 멤버
if(!$status) {
$que="select * from $member_table $s_que order by no desc limit $start_num,$page_num";
$result=mysql_query($que) or Error(mysql_error());
// 온라인 멤버
} else {
$endnum = $start_num + $page_num;
if($endnum>$total) $endnum=$total;
unset($s_que);
for($i=$start_num;$i<$endnum;$i++) {
$member_no = substr($_connector[$i],12);
if($s_que) $s_que .= " or no = '$member_no' "; else $s_que = " where no = '$member_no' ";
}
$que = "select * from $member_table $s_que";
$result=mysql_query($que) or Error(mysql_error());
}
// 페이지 계산 $print_page 라는 변수에 저장
$print_page="";
$show_page_num=10;
$start_page=(int)(($page-1)/$show_page_num)*$show_page_num;
$i=1;
if($page>$show_page_num) {
$prev_page=$start_page;
$print_page="<a href=$PHP_SELF?page=$prev_page&status=$status&keyword=$keyword>[Prev]</a> ";
$print_page.="<a href=$PHP_SELF?page=1&status=$status&keyword=$keyword>[1]</a>..";
}
while($i+$start_page<=$total_page&&$i<=$show_page_num) {
$move_page=$i+$start_page;
if($page==$move_page) $print_page.=" <b>$move_page</b> ";
else $print_page.="<a href=$PHP_SELF?page=$move_page&status=$status&keyword=$keyword>[$move_page]</a>";
$i++;
}
if($total_page>$move_page) {
$next_page=$move_page+1;
$print_page.="..<a href=$PHP_SELF?page=$total_page&status=$status&keyword=$keyword>[$total_page]</a>";
$print_page.=" <a href=$PHP_SELF?page=$next_page&status=$status&keyword=$keyword>[Next]</a>";
}
head("bgcolor=white");
?>
<script language=JavaScript>
function bluring(){
if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus();
}
document.onfocusin=bluring;
</script>
<style type='text/css'>
body {color:#181818}
A:link {color:#181818;text-decoration:none;}
A:visited {color:#181818;text-decoration:none;}
A:active {color:#181818;text-decoration:none;}
A:hover {color:#181818;text-decoration:none;}
body
{ scrollbar-3dlight-color: #B4B4B4;
scrollbar-arrow-color: #333333;
scrollbar-base-color: #EEEEEE;
scrollbar-darkshadow-color: #FFFFFF;
scrollbar-face-color: #EEEEEE;
scrollbar-highlight-color: #FFFFFF;
scrollbar-shadow-color: #B4B4B4
}
.input {border:1px #dddddd solid;height:18px;font-family:tahoma;font-size:9pt;color:#666666;background-color:#fafafa;}
</style>
<table cellpadding="0" cellspacing="0" width="400" align="center">
<tr>
<td width="966" height="55"><img align="top" src="pop_img/memo/list_top.gif" width="400" height="55" border="0"></td>
</tr>
<tr>
<td width="966" height="24" align="center">
<table width="380" cellpadding="0" cellspacing="0">
<tr>
<td width="6" height="23"></td>
<td width="250" height="23"><a href=member_memo.php><img src=pop_img/memo/recive.gif width="78" height="24" border=0></a><a href=member_memo2.php><img src=pop_img/memo/send_memo.gif width="78" height="24" border=0></a><a href=member_memo3.php><img src=pop_img/memo/member_list2.gif width="78" height="24" border="0"></a></td>
<td width="124" height="23">
<table cellpadding="0" cellspacing="0" width="120" height="24">
<tr>
<td width="129" height="3"></td>
</tr>
<tr>
<td width="129" align="center"><font style=font-family:Tahoma;font-size:7pt;color:#181818>All Members : <b><?=$total?></b></font></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="966" height="29" align="center" valign="top">
<script>
function check_status()
{
if(document.list.status.checked) {
if(document.list.keyword.value) {
alert("온라인 상태에서는 검색할수가 없습니다");
return false;
}
}
return true;
}
</script>
<table cellpadding="0" cellspacing="0" width="380">
<form method=post action=<?=$PHP_SELF?> name=list onsubmit="return check_status()">
<input type=hidden name=page value=<?=$page?>>
<tr>
<td colspan=4 height=1 background="pop_img/memo/dot6.gif"></td>
</tr>
<tr align=center height=27>
<td width=30% height="27" bgcolor="white">
<p align="center"><b><font style=font-family:Tahoma;font-size:8pt;color:#666666>LEVEL</font><b></td>
<td width=30% height="27" bgcolor="white">
<p align="center"><b><font style=font-family:Tahoma;font-size:8pt;color:#666666>ID</font><b></td>
<td width=25% height="27" bgcolor="white">
<p align="center"><b><font style=font-family:Tahoma;font-size:8pt;color:#666666>NAME</font><b></td>
<?if($status){?><td width=15% height="27" bgcolor="white">
<p align="center"><b><font style=font-family:Tahoma;font-size:8pt;color:#666666>STATUS</font><b></td>
<?}?>
</tr>
<?
// 출력
$loop_number=$total-($page-1)*$page_num;
while($data=mysql_fetch_array($result)) {
$name=stripslashes($data[name]);
$temp_name = get_private_icon($data[no], "2");
if($temp_name) $name="<img src='$temp_name' border=0 align=absmiddle>";
$temp_name = get_private_icon($data[no], "1");
if($temp_name) $name="<img src='$temp_name' border=0 align=absmiddle> ".$name;
$user_id=stripslashes($data[user_id]);
//$check=mysql_fetch_array(mysql_query("select count(*) from $now_table where user_id='$data[user_id]'"));
if($check[0]) $stat="<img src=images/memo_online2.gif>";
else $stat="<img src=images/memo_offline.gif>";
if($data[is_admin]==1) $kind="<font color=#666666 style=font-family:Tahoma;font-size:8pt;><b>Super Administrator</b>($data[level])</font>";
elseif($data[is_admin]==2) $kind="<font color=#666666 style=font-family:Tahoma;font-size:8pt;><b>Group Administrator</b>($data[level])</font>";
else $kind="<font style=font-family:Tahoma;font-size:8pt;><b>Member</b>($data[level])</font>";
echo"
<tr>
<td colspan=5 background=pop_img/memo/dot6.gif align=center><img src=images/t.gif width=10 height=1></td>
</tr>
<tr align=center height=27 onMouseOver=this.style.backgroundColor=\"#F7f7ef\" onMouseOut=this.style.backgroundColor=\"\" style=cursor:hand; onclick=location.href=\"javascript:void(window.open('view_info.php?member_no=$data[no]','view_info','width=400,height=500,toolbar=no,scrollbars=yes'))\">
<td style='word-break:break-all;'>$kind</td>
<td style='word-break:break-all;'><img src=images/t.gif width=10 height=3><br><a href=javascript:void(window.open('view_info.php?member_no=$data[no]','view_info','width=400,height=500,toolbar=no,scrollbars=yes'))>$user_id</a></td>
<td style='word-break:break-all;'><img src=images/t.gif width=10 height=3><br>$name</td>";
if($status) echo"<td style='word-break:break-all;'><img src=images/memo_online2.gif></td>";
echo"
</tr>
";
$loop_number--;
}
?>
<tr>
<td colspan=4 height=1 background="pop_img/memo/dot6.gif"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="966" height="50" align="center" valign="top"></td>
</tr>
<? $checked[$status]="checked"; ?>
<tr>
<td width="966" height="25" align="center">
<table border=0 cellpadding=0 cellspacing=0 style="border:1px #eeeeee solid;" align=center>
<tr>
<td height=3 colspan=5></td>
</tr>
<tr>
<td><input type=checkbox value=1 name=status <?=$checked[1]?>></td>
<td><b><font style=font-family:Tahoma;font-size:7pt;color:#666666>ONLINE</font><b> </td>
<td>
<input type=text name=keyword value="<?=$keyword?>" size=20 style=font-size:9pt;width:140px;height:18px;border-color:#eeeeee;background-color:#f7f7f7; class=input></td>
<td><INPUT TYPE="submit" class=input value=Search style=color:#FFFFFF;border-color:#666666;background-color:#666666;font-size:7pt;font-family:Tahoma;height:18px;> </td>
<td><a href=<?=$PHP_SELF?>?page=<?=$page?>><b><font style=font-family:Tahoma;font-size:7pt;color:#666666>MEMBER</font><b></a> </td>
</tr>
<tr>
<td height=3 colspan=5></td>
</tr>
</table>
<table cellpadding="0" height="100" cellspacing="0" width="380">
<tr>
<td width="226" height="100"> <font style=font-family:Tahoma;font-size:7pt;color:#666666><?=$print_page?></font></td>
<td width="54" height="100"></td>
<td width="60" height="100" align="center"><a href=JavaScript:window.close()><img src="pop_img/memo/exit_button.gif" width="51" height="47" border="0"></td>
</tr>
</form>
</table>
</td>
</tr>
<tr>
<td width="966" height="15"></td>
</tr>
</table>
<?
// MySQL 닫기
if($connect) mysql_close($connect);
foot();
?>
뭐가 잘못된거죠ㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠ?
전 여기 아무것도 건드리지 않았는데 ㅠㅠㅠㅠ


