질문입니다.(5천 포인트) > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

질문입니다.(5천 포인트) 정보

질문입니다.(5천 포인트)

본문

$m[mb_name]이 안뜨는데 왜그럴까요?
해당 소스는

$query1 = "select * from g4_member where mb_id = '$view[wr_1]'";
$result1 = mysql_query($query1);
$m = mysql_fetch_array($result1);
echo $query1."<hr>";
echo $m[mb_name]."<hr>";

입니다.

echo $query1."<hr>";

는 정상적으로
select * from g4_member where mb_id = 'teat2'
처럼되는데.

echo $m[mb_name]."<hr>";

이게 작동이 안되네요.
잠이와서 그런지 아무리 찾아도 원인을 모르겟습니다.


소스전체

<?
///////////////////////////////////////////////////////
///////////////////////////////////////////////////////
//                      정보택                       //
///////////////////////////////////////////////////////
// (주) 인포큐브                                     //
// 제작 : 임동덕                                     //
// 연락처 : Tel: (062) 511-0380, Fax: (062) 511-0381 //
///////////////////////////////////////////////////////
///////////////////////////////////////////////////////
include_once("./_common.php");
$query = "select * from g4_write_$bo_table where wr_id = '$wr_id' order by wr_id";  // 주소 변수 값으로 쿼리함
$result = mysql_query($query);
$view = mysql_fetch_array($result);
$content = explode("|", $view[wr_content]); // 컨텐츠를 쪼개 옴
//////////////////////////////////////////////
// 글쓴 회사 데이터 로드
$query = "select * from g4_member where mb_id = '$view[mb_id]'";
$result = mysql_query($query);
$my = mysql_fetch_array($result);
//////////////////////////////////////////////
// 감리자 데이터 로드
$query1 = "select * from g4_member where mb_id = '$view[wr_1]'";
$result1 = mysql_query($query1);
$m = mysql_fetch_array($result1);
echo $query1."<hr>";
echo $m[mb_name]."<hr>";
//////////////////////////////////////////////
// 페이지 권한 설정
if($is_admin == "super" | $my[mb_id] == $member[mb_id] | $m[mb_id] == $member[mb_id]){  // 관리자, 글쓴회사, 감리자회사 에게 글보기 권한 부여
?>
<!-- 인쇄 영역 설정 -->
<div id="print">
<object id=factory viewastext style="display:none"
classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814"
  codebase="ScriptX.cab#Version=6,1,431,8">
</object>

<!-- 환경설정 -->
<style>
.table{ width:100%; border:1px solid #000; }
.th{ text-align:center; width:50px; padding-top:10px; padding-bottom:10px;  background-color:#fbfbee; border-right:1px solid #000; }
.td{ text-align:center; border-right:1px solid #000; height:50px; }
.left{ text-align:left; }
</style>
<!-- 데이터 리로드시 쓰일 필드 쪼개기 -->
<?
// 필드 쪼개기
$content = explode("|", $write["wr_content"]);
?>

<!-- /데이터 리로드시 쓰일 필드 쪼개기/ -->
<!-- /환경설정/ -->

<div style="text-align:center;"><b><h1>업무대행자지정서</h1><b></div>
<!-- 업무대행자 -->
<div style="float:left;">■업무대행자교부용</div>
<div style="text-align:right; float:right;">(발행번호 : <?=$datetime = date("Y-",strtotime($write[wr_datetime]));?> <?=str_replace("-","",$write[wr_num]);?> 번)</div>



<table  class="table" style="border-bottom:1px; margin:0px; padding:0px;" cellpadding=0 cellspacing=0>
<!-- 구분 -->
<tr>
<th class="th">구분</th>
<td style="text-align:left; padding-left:10px;">
<? if($write[wr_2] == "1"){ echo "사용승인"; }elseif($write[wr_2] == "2"){ echo "임시사용승인"; } else{ echo "신청서 접수 오류"; } ?>
</td>
</tr>
<!-- /구분/ -->
<!--  업무대행자 -->
<tr>
<th class="th" style="border-top:1px solid #000;">업<br />무<br />대<br />행<br />자</th>
<td style="text-align:left; padding-left:0px; border-top:1px solid #000;">
<table  class="table" style=" border-bottom:0px; border-right:0px; margin:0px; padding:0px; border-left:0px; border-top:0px;" cellpadding=0 cellspacing=0>
<tr>
<td width="100px" style="font-weight: bold; border-bottom:1px solid #000; border-top:0px" class="td">성명</td>
<td width="40%" class="left"  style="border-bottom:1px solid #000; border-right:1px solid #000;">
&nbsp;<? if($write[wr_1]){ echo $m[mb_name]; }?><? if($write[wr_1] == ""){ echo "<img src=\"$board_skin_path/img/auto.jpg\">"; } ?>
</td>
<td width="100px" style="font-weight: bold; border-bottom:1px solid #000;" class="td">자격번호</td>
<td width="40%" class="left" style="border-bottom:1px solid #000;">
&nbsp;<? if($write[wr_1]){ echo $m[mb_6]; }?><? if($write[wr_1] == ""){ echo "<img src=\"$board_skin_path/img/auto.jpg\">"; } ?>
</td>
</tr>

<tr>
<td style="font-weight: bold; border-bottom:1px solid #000;" class="td">사무소명</td>
<td class="left" style="border-bottom:1px solid #000; border-right:1px solid #000;">
&nbsp;<? if($write[wr_1]){ echo $m[mb_nick]; }?><? if($write[wr_1] == ""){ echo "<img src=\"$board_skin_path/img/auto.jpg\">"; } ?>
</td>
<td style="font-weight: bold; border-bottom:1px solid #000; font-size:8pt;" class="td">업무신고번호</td>
<td class="left" style="border-bottom:1px solid #000;">
&nbsp;<? if($write[wr_1]){ echo $m[mb_5]; }?><? if($write[wr_1] == ""){ echo "<img src=\"$board_skin_path/img/auto.jpg\">"; } ?>
</td>
</tr>

<tr>
<td style="font-weight: bold; border-bottom:1px solid #000; border-bottom:0px" class="td">소재지</td>
<td class="left" style="border-bottom:1px solid #000; border-right:1px solid #000; border-bottom:0px;  border-right:0px;" colspan="3">
&nbsp;<? if($write[wr_1]){ echo $m[mb_addr1].$m[mb_addr2]."&nbsp;&nbsp;(전화번호: ".$m[Location_phone].")"; }?><? if($write[wr_1] == ""){ echo "<img src=\"$board_skin_path/img/auto.jpg\">"; } ?>
</td>
</tr>

</table>
</td>
</tr>
<!--  /업무대행자/ -->
<tr>
<th class="th" style="border-top:1px solid #000;">업<br />무<br />대<br />행<br />대<br />상</th>
<td style="vertical-align:top;">
<table  class="table" style=" border-bottom:0px; border-right:0px; margin:0px; padding:0px; border-left:0px;" cellpadding=0 cellspacing=0>
<tr>
<td width="100px" style="font-weight: bold; border-bottom:1px solid #000;" class="td">대지위치</td>
<td width="40%" class="left"  style="border-bottom:1px solid #000; border-right:1px solid #000;">
&nbsp;<?=$content[1]?>
</td>
<td width="100px" style="font-weight: bold; border-bottom:1px solid #000;" class="td">허가번호</td>
<td width="40%" class="left" style="border-bottom:1px solid #000;">
<?=$content[2]?>
</td>
</tr>

<tr>
<td style="font-weight: bold; border-bottom:1px solid #000;" class="td">건축주</td>
<td class="left" style="border-bottom:1px solid #000; border-right:1px solid #000;">
&nbsp;<?=$content[3]?>
</td>
<td style="font-weight: bold; border-bottom:1px solid #000;" class="td">착공일자</td>
<td class="left" style="border-bottom:1px solid #000;">
&nbsp;<?=$content[4]?>
</td>
</tr>

<tr>
<td style="font-weight: bold; border-bottom:1px solid #000;" class="td">허가일자</td>
<td class="left" style="border-bottom:1px solid #000; border-right:1px solid #000;">
&nbsp;<?=$content[5]?>
</td>
<td style="font-weight: bold; border-bottom:1px solid #000;" class="td">연면적</td>
<td class="left" style="border-bottom:1px solid #000;">
&nbsp;<?=$content[6]?>
</td>
</tr>

<tr>
<td style="font-weight: bold; border-bottom:1px solid #000;" class="td">건축면적</td>
<td class="left" style="border-bottom:1px solid #000; border-right:1px solid #000;">
&nbsp;<?=$content[7]?>
</td>
<td style="font-weight: bold; border-bottom:1px solid #000;" class="td">구조</td>
<td class="left" style="border-bottom:1px solid #000;">
&nbsp;<?=$content[8]?>
</td>
</tr>

<tr>
<td style="font-weight: bold;" class="td">용도</td>
<td class="left" style=" border-right:1px solid #000;">
&nbsp;<?=$content[9]?>
</td>
<td style="font-weight: bold;" class="td">층수</td>
<td class="left">
&nbsp;지상 <?=$content[10]?>층 / 
지하 <?=$content[11]?>층
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- /업무대행자/ -->

<!-- 설계자, 감리자, 기타 -->
<table  class="table" style="margin:0px; padding:0px;" cellpadding=0 cellspacing=0>
<tr>
<th class="th" style="border-bottom:0px;">설<br />계<br />자</th>
<td>
<table  height=100% class="table" style=" border-bottom:0px; border-left:0px; border-top:0px; border-right:0px; margin:0px; padding:0px;" cellpadding=0 cellspacing=0>
<tr>
<td width="80px" style="font-weight: bold; border-bottom:1px solid #000;" class="td">성명</td>
<td class="left" style="border-bottom:1px solid #000; border-right:1px solid #000; width:322px;">
&nbsp;<?=$my[mb_name]?>
</td>
<td width="80px" style="font-weight: bold; border-bottom:1px solid #000;" class="td">사무소명</td>
<td class="left" style="border-bottom:1px solid #000;">
&nbsp;<?=$my[mb_nick]?>
</td>
</tr>
<tr>
<td style="font-weight: bold;" class="td">주소</td>
<td colspan=3 class="left">
&nbsp;<?=$my[mb_addr1]?> <?=$my[mb_addr2]?>&nbsp;&nbsp;
</td>
</tr>
</table>
</td>
</tr>

<tr>
<th class="th" style="border-bottom:0px; border-top:1px solid #000;">감<br />리<br />자</td>
<td>
<table height=100% class="table" style=" border-bottom:0px; border-right:0px; border-left:0px; margin:0px; padding:0px;" cellpadding=0 cellspacing=0>
<tr>
<td width="80px" style="font-weight: bold; border-bottom:1px solid #000;" class="td">성명</td>
<td class="left" style="border-bottom:1px solid #000; border-right:1px solid #000; width:322px;">
&nbsp;<?=$content[15]?>
</td>
<td width="80px" style="font-weight: bold; border-bottom:1px solid #000;" class="td">사무소명</td>
<td class="left" style="border-bottom:1px solid #000;">
&nbsp;<?=$content[16]?>
</td>
</tr>
<tr>
<td style="font-weight: bold;" class="td">주소</td>
<td colspan=3 class="left">
&nbsp;<?=$content[17]?>
</td>
</tr>
</table>
</td>
</tr>

</table>
</td>
</tr>
</table>

<div style="text-align:center; padding-top:20px;">
<div style="text-align:left;">
&nbsp;&nbsp; 업무대행건축사 선임 등에 관한 업무처리규정 제7조에 따라 업무대행건축사로 지정 합니다.<p>
※ 첨부 : 공사감리 완료 보고서 1부.<p><br></div>
<div style="text-align:center;">
<?
        // $list[$i][datetime] // 기본 게시글 날짜 함수 주석
        $datetime = date("Y년 m월  d일",strtotime($write[wr_datetime]));
        echo "<h2>".$datetime."</h2>";
?>
</div>
</div>


</div>
<!-- 인쇄영역 여기까지. -->




<div style="text-align:center;">
<?
if(!$write[wr_1]){
  echo "<font color='chocolate'>비정상적인 접근입니다. 업무대행자지정 추첨 후 출력하실수 있습니다.</font>";;
}elseif($write[wr_1]){
  echo "<button onclick=\"printArea()\">인쇄하기</button>";
}
?>
</div>







<script type="text/javascript">
<!--
var initBody;

function beforePrint() {
 prints = document.body.innerHTML;
 document.body.innerHTML = document.getElementById('print').innerHTML;
}
function afterPrint() { 
 document.body.innerHTML = prints;
}
function printArea() {
  factory.printing.header       = ""
  factory.printing.footer       = ""
  factory.printing.portrait     = true // true 세로출력 , false 가로출력
  factory.printing.leftMargin   = 10
  factory.printing.topMargin    = 20
  factory.printing.rightMargin  = 10
  factory.printing.bottomMargin = 10
  window.print();
}

window.onbeforeprint = beforePrint;
window.onafterprint = afterPrint;

-->
</script>
<?}else{ echo "<script type='text/javascript'>alert('접근 권한이 없습니다.'); self.close();</script>"; }?>
<!-- 자스로 브라우저 타이틀 지정 -->
<SCRIPT LANGUAGE="JavaScript"> 
var defaultTitle = document.title;
function title() {
document.title = "업무대행자지정서";
}
if (document.all) title();
</script>
<!-- /자스로 브라우저 타이틀 지정/ -->

댓글 전체

위에 다른 부분들은 정상적으로 받아 오시나요?
26 라인에
var_dump($my);
echo "<hr />";
var_dump($m);
echo "<hr />";
var_dump($m[mb_name]);
echo "<hr />";
var_dump(mb_name);
echo "<hr />";
하셔서 정상적으로 값을 받아오나 확인해보시지요
전체 66,554 |RSS
그누4 질문답변 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT