묻고답하기
[PHP] DB 에 저장된 내용을 못 불러와요~ ㅜㅜ
2007.10.29 10:39
안녕하세요,
홈페이지 상에서 신청서를 받고 있는데요,
신청서 작성 페이지랑 신청한 사람 리스트 보는 페이지까지는 아무 문제가 없는데,
리스트에서 이름을 눌러서 세부 내용을 보려고 하면 DB에 있는 DATA를 불러오지 못합니다.
포맷만 보이고 실제 내용은 하나도 안 나와요. 무엇이 잘못 된 것일까요? 도움 부탁드립니다.
리스트(camp_list.php)랑 세부내용(camp_view.php) 파일 첨부할게요~!
참고로, DB 상에는 입력한 내용이 모두 제대로 저장이 되어 있습니다.
도움 부탁드려요.ㅜㅜ
* camp_list.php : 정상으로 보임
<?php
session_start();
include "../UriBoard/include/shellbru.ph" ;
include "../UriBoard/include/stopWatch.class" ;
if(!$admin_id || !$admin_pwd)
{
ScriptMSG ('관리자만 사용하실 수 있습니다');
echo('<meta http-equiv=\'Refresh\' content=\'0;URL=../login/login.php\'>');
exit;
}
//실행시간 측정을 위해, stopwatch 실행
$MyStopWatch = new stopwatch() ;
if(!$page) {
$page = 1 ;
}
if(!$table) {
$table = 'UBoard_camp';
}
$tb = $table ;
//db 접속----------------------------------------------------------------------------------->
$connect = mysql_connect($db_host, $db_user, $db_passwd);
mysql_select_db($db_name,$connect);
//게시판 정보 불러오기
$bbs_info = fetch_bbs_info($table) ;
?>
<html>
<head>
<title>pictionary.co.kr</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<link href="../style/style.css" rel="stylesheet" type="text/css">
<script src="../js/showactivex.js" type="text/javascript"></script>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>
<body leftmargin="0" bgcolor="ffffff" topmargin="0" marginwidth="0" marginheight="0" onLoad="MM_preloadImages('../images/sub/left_menu_05_02_on.gif','../images/sub/left_menu_02_02_on.gif','../images/sub/left_menu_02_01_on.gif')">
<table width="917" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
<? include "../include/top.php" ?>
</td>
</tr>
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="181" valign="top"><table width="173" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="../images/sub/left_title_02.gif" width="173" height="33"></td>
</tr>
<tr>
<td align="center"><table width="163" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="26" style="background-image:url(../images/sub/left_line.gif); background-repeat:no-repeat; background-position:bottom;"><a href="regular.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image3','','../images/sub/left_menu_02_01_on.gif',1)"><img src="../images/sub/left_menu_02_01_off.gif" name="Image3" width="66" height="18" border="0"></a></td>
</tr>
<tr>
<td height="26" style="background-image:url(../images/sub/left_line.gif); background-repeat:no-repeat; background-position:bottom;"><a href="special.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image4','','../images/sub/left_menu_02_02_on.gif',1)"><img src="../images/sub/left_menu_02_02_off.gif" name="Image4" width="66" height="18" border="0"></a></td>
</tr>
<tr>
<td height="26" style="background-image:url(../images/sub/left_line.gif); background-repeat:no-repeat; background-position:bottom;"><a href="camp.php"><img src="../images/sub/left_menu_02_03_on.gif" width="66" height="18" border="0"></a></td>
</tr>
</table></td>
</tr>
<tr>
<td style="padding-top:15px;"><? include "../include/left.php" ?>
</td>
</tr>
</table></td>
<td valign="top">
<table width="726" border="0" cellspacing="0" cellpadding="0" style="margin-left:9px;">
<tr>
<td><img src="../images/sub/menu_02_title_03.gif" width="726" height="34"></td>
</tr>
<tr>
<td align="center" style="padding-top:20px; padding-bottom:40px;">
<table width="695" border="0" cellspacing="0" cellpadding="0" style="margin-left:25px; margin-top:30px;">
<tr>
<td><img src="../images/board/board_top.gif" width="695" height="7"></td>
</tr>
<tr>
<td align="center" style="background-image:url(../images/board/board_center.gif); background-repeat:repeat-y;">
<!-- 리스트 타이틀 테이블-->
<table width="672" border="0" cellspacing="0" cellpadding="0">
<tr align="center">
<td width="120" height="30" style="border-bottom:1px solid #cec3b1;"><img src="../images/board/t_01.gif" width="22" height="13"></td>
<td width="291" style="border-bottom:1px solid #cec3b1;"><img src="../images/board/t_02.gif" width="31" height="13"></td>
<td width="261" style="border-bottom:1px solid #cec3b1;"><img src="../images/board/t_05.gif" width="31" height="13"></td>
</tr>
</table>
<!-- 리스트 타이틀 테이블-->
<!--list시작-->
<table width="672" border="0" cellspacing="0" cellpadding="0" style="margin-top:2px;">
<?
$query = "select * from $tb order by number desc" ;
$dbresult = mysql_query($query, $connect) ;
if(!$dbresult) {
ScriptErrMsg('테이블에서 게시판 목록 불러오는 도중 sql 에러 발생') ;
}
$totalnumber = mysql_num_rows($dbresult);
$cpage = intval($page);
if($totalnumber) {
$totalpage = intval($totalnumber/$LIST_PER_PAGE);
}
if ($totalpage*$LIST_PER_PAGE != $totalnumber)
$totalpage = $totalpage + 1;
if ($cpage ==1) {
$cline = 0 ;
////////////////////////////////////////////////////////////
$num = $totalnumber;
////////////////////////////////////////////////////////////
}
else
{
$cline = ($cpage*$LIST_PER_PAGE) - $LIST_PER_PAGE - 1 ;
//$cline = ($cpage*$LIST_PER_PAGE) - $LIST_PER_PAGE ; -- 2페이지 넘어갈때 글이 하나씩 사라지는 현상이 있어서 위처럼 수정했음
////////////////////////////////////////////////////////////
$num = $totalnumber - $cline - 1;
//$num = $totalnumber - $cline ; -- 2페이지 넘어갈때 글이 하나씩 사라지는 현상이 있어서 위처럼 수정했음
////////////////////////////////////////////////////////////
}
$limit=$cline+$LIST_PER_PAGE;
if ($limit >= $totalnumber)
$limit=$totalnumber;
$today = date("Y-m-d");
$today = split("-", $today) ; //날짜 연산을 위해
//본문테이블-------------------------------------------->
//loop를 돌며 게시물의 목록을 출력
for($i=$cline ; $i < $limit ; $i++ ) {
mysql_data_seek($dbresult, $i) ;
$row = mysql_fetch_array($dbresult) ;
$row[koname] = stripSlashes($row[koname]) ;
$wdate = date("Y-m-d", $row[wdate]) ;
?>
<tr>
<td width="119" height="30" align="center" > <?=$row[number]?> </td>
<td width="293" align="center" ><a href=camp_view.php?&number=<?=$row[number]?>&page=<?=$page?>&table=<?=$table?> class='bb'><?=$row[koname]?></a></td>
<td width="260" align="center"><?=$wdate?> </td>
</tr>
<tr>
<td colspan="3" align="center" ><img src="../images/board/board_line.gif" width="672" height="3"></td>
</tr>
<? $cline++ ;
}
//loop 끝
?>
</table>
<!--list끝-->
<!--버튼들-->
<table width="672" border="0" cellspacing="0" cellpadding="0" style="margin-top:6px;">
<tr align="center">
<td width="69" height="30" > </td>
<td width="534" >
<?
$pagenumber = 10;
$startpage = intval(($cpage - 1) / $pagenumber) * $pagenumber +1 ;
$endpage = intVal(((($startpage -1) + $pagenumber) / $pagenumber) * $pagenumber) ;
if ($totalpage <= $endpage)
$endpage = $totalpage;
if ( $cpage > $pagenumber) {
$curpage = intval($startpage - 1);
echo ("<a href=camp_list.php?&table=$table&page=$curpage>◀</a> ");
}
else
{
echo "◀ ";
}
$curpage = $startpage;
while ($curpage <= $endpage):
if ($curpage == $cpage) {
echo ("<font color=red><b>[$cpage]</b></font> ");
}
else
{
echo ("<a href=camp_list.php?&table=$table&page=$curpage>[$curpage]</a> ");
}
$curpage++;
endwhile ;
if ( $totalpage > $endpage) {
$curpage = intval($endpage + 1);
echo " <a href=camp_list.php?&order=boardlist&table=$table&page=$curpage>▶</a>";
}
else
{
echo " ▶ ";
}
?>
</td>
<td width="69" align="right" > </td>
</tr>
</table>
<!--버튼들-->
</td>
</tr>
<tr>
<td><img src="../images/board/board_bottom.gif" width="695" height="7"></td>
</tr>
</table> </td>
</tr>
</table>
</td>
</tr>
</table></td>
</tr>
</table>
<? include "../include/bottom.php" ?>
</body>
</html>
* camp_view.php : 포맷만 보이고 실제 data를 못 불러옴
<?
session_start();
include "../UriBoard/include/shellbru.ph" ;
$tb = "UBoard_".$table ;
$connect = mysql_connect($db_host, $db_user, $db_passwd);
mysql_select_db($db_name,$connect);
//해당 게시판 정보 가져옴
$bbs_info = fetch_bbs_info($table) ;
?>
<html>
<head>
<title>pictionary.co.kr</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<link href="../style/style.css" rel="stylesheet" type="text/css">
<script src="../js/showactivex.js" type="text/javascript"></script>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>
<body leftmargin="0" bgcolor="ffffff" topmargin="0" marginwidth="0" marginheight="0" onLoad="MM_preloadImages('../images/sub/left_menu_05_02_on.gif','../images/sub/left_menu_02_02_on.gif','../images/sub/left_menu_02_01_on.gif')">
<table width="917" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
<? include "../include/top.php" ?>
</td>
</tr>
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="181" valign="top"><table width="173" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="../images/sub/left_title_02.gif" width="173" height="33"></td>
</tr>
<tr>
<td align="center"><table width="163" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="26" style="background-image:url(../images/sub/left_line.gif); background-repeat:no-repeat; background-position:bottom;"><a href="regular.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image3','','../images/sub/left_menu_02_01_on.gif',1)"><img src="../images/sub/left_menu_02_01_off.gif" name="Image3" width="66" height="18" border="0"></a></td>
</tr>
<tr>
<td height="26" style="background-image:url(../images/sub/left_line.gif); background-repeat:no-repeat; background-position:bottom;"><a href="special.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image4','','../images/sub/left_menu_02_02_on.gif',1)"><img src="../images/sub/left_menu_02_02_off.gif" name="Image4" width="66" height="18" border="0"></a></td>
</tr>
<tr>
<td height="26" style="background-image:url(../images/sub/left_line.gif); background-repeat:no-repeat; background-position:bottom;"><a href="camp.php"><img src="../images/sub/left_menu_02_03_on.gif" width="66" height="18" border="0"></a></td>
</tr>
</table></td>
</tr>
<tr>
<td style="padding-top:15px;"><? include "../include/left.php" ?>
</td>
</tr>
</table></td>
<td valign="top">
<table width="726" border="0" cellspacing="0" cellpadding="0" style="margin-left:9px;">
<tr>
<td><img src="../images/sub/menu_02_title_03.gif" width="726" height="34"></td>
</tr>
<tr>
<td align="center" style="padding-top:20px; padding-bottom:40px;">
<table width="695" border="0" cellpadding="0" cellspacing="0" bordercolor="#666666" bgcolor="#F8F9F3" style=" margin-top:30px;">
<tr>
<form method=post name=up action=camp_write_act.php ENCTYPE=multipart/form-data onsubmit="return fm_submit();">
<input type=hidden name=table value="camp">
<input type=hidden name=page value=<?=$page?>>
<td><img src="../images/board/board_top.gif" width="695" height="7"></td>
</tr>
<tr>
<td align="center" style="background-image:url(../images/board/board_center.gif); background-repeat:repeat-y;">
<img src="../images/board/camp_t.gif" width="164" height="43" vspace="20"></tr>
<tr><td>
<table width="660" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC" >
<tr>
<td width="61" rowspan="2" align="center" bgcolor="#F8F9F3">학생이름</td>
<td width="238" bgcolor="#F8F9F3">(한글)
<?=$koname?>
</td>
<td width="104" align="center" bgcolor="#F8F9F3">성별</td>
<td width="228" bgcolor="#F8F9F3">
<?=$row[sex]?>
</td>
</tr>
<tr>
<td bgcolor="#F8F9F3">(영문)
<?=$enname?>
</td>
<td width="104" align="center" bgcolor="#F8F9F3">입금자
성명 </td>
<td bgcolor="#F8F9F3">
<?=$prname?>
</td>
</tr>
<tr>
<td align="center" bgcolor="#F8F9F3">생년월일</td>
<td colspan="3" bgcolor="#F8F9F3">
<?=$birth_year?>
년도
<?=$birth_month?>
월
<?=$birth_date?>
일 </td>
</tr>
<tr>
<td align="center" bgcolor="#F8F9F3">소속</td>
<td colspan="3" bgcolor="#F8F9F3">
<?=$position?>
<?=$row[school]?>
<?=$row[grade]?>
학년</td>
</tr>
<tr>
<td rowspan="5" align="center" bgcolor="#F8F9F3">연락처</td>
<td colspan="3" bgcolor="#F8F9F3">자택번호<font color="#F8F9F3">----
---</font>
<?=$row[phone1]?>
-
<?=$row[phone2]?>
-
<?=$row[phone3]?>
</td>
</tr>
<tr bgcolor="#F8F9F3">
<td colspan="3">휴대폰(본인)<font color="#F8F9F3">----</font>
<?=$row[cell1]?>
-
<?=$row[cell2]?>
-
<?=$row[cell3]?>
</td>
</tr>
<tr bgcolor="#F8F9F3">
<td colspan="3">휴대폰(학부형)<font color="#F8F9F3">--</font>
<?=$row[cell_parent1]?>
-
<?=$row[cell_parent2]?>
-
<?=$row[cell_parent3]?>
</td>
</tr>
<tr bgcolor="#F8F9F3">
<td colspan="3">이메일(본인)<font color="#F8F9F3">----</font>
<?=$email1?>
@
<?=$email2?>
</td>
</tr>
<tr bgcolor="#F8F9F3">
<td colspan="3">이메일(학부형)<font color="#F8F9F3">--</font>
<?=$email3?>
@
<?=$email4?>
</td>
</tr>
<tr>
<td align="center" bgcolor="#F8F9F3">주소</td>
<td colspan="3" bgcolor="#F8F9F3">
<?=$row[address]?>
</td>
</tr>
<tr>
<td align="center" bgcolor="#F8F9F3">캠프선택</td>
<td colspan="3" bgcolor="#F8F9F3" style="padding-left:20px;">
<?=$row[classes]?>
</td>
</tr>
<tr>
<td width="61" align="center" bgcolor="#F8F9F3">제주캠프<br>
출발지역</td>
<td width="238" bgcolor="#F8F9F3">
<?=$row[area1]?>
</td>
<td width="104" align="center" bgcolor="#F8F9F3">제주캠프<br>
도착지역</td>
<td width="228" bgcolor="#F8F9F3">
<?=$row[area2]?>
</td>
</tr>
<tr>
<td align="center" bgcolor="#F8F9F3">픽셔네리에<br>
하고픈 말</td>
<td colspan="3" bgcolor="#F8F9F3"><?=$row[etc]?></td>
</tr>
</table></td>
</tr>
<tr>
<td><img src="../images/board/board_bottom.gif" width="695" height="7"></td>
</tr>
</table>
<table width="695" border="0" cellspacing="0" cellpadding="0" style="margin-top:10px;">
<tr>
<td align="center"><img src="../images/board/btn_cancel.gif" width="60" height="21"> <input class="input_btn" name="image" type=image onFocus=blur() src="../images/board/btn_confirm.gif" width="60" height="21" ></td>
</tr>
</table></td>
</tr>
</table>
</td>
</tr>
</table></td>
</tr>
</table>
<? include "../include/bottom.php" ?>
</body>
</html>