첨부파일관련 문의드립니다. > 그누4 질문답변

그누4 질문답변

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

첨부파일관련 문의드립니다. 정보

첨부파일관련 문의드립니다.

첨부파일

pot.php (6.5K) 1회 다운로드 2007-04-30 21:03:57

본문

위에 링크를 클릭하시면 왼쪽 메뉴가 나오고 그걸 클릭하면 오른쪽에 이미지를 읽어오
 
도록 만들었습니다. 물론 그냥 디비에서 읽어들여오기만 하는것입니다.
 
문의 드릴내용..
 
이게 일반 게시판을 응용해서 만든거입니다. 일반게시판의 리스트가 왼쪽에 오도록 했
 
고 오른쪽에는 첨부파일이 나오도록 했습니다.
 
문의드릴내용 첫번째...
 
첨부파일에서 2개이상의 이미지를 첨부했을때 이미지가 한개만 보이도록 하려고 합니다
 
이때 오른쪽에 보이는 이미지는 1개만 보이고 2번째 이미지는 오른쪽하단이 숫자2번을
 
클릭하면 보이도록 하려고 합니다.
 
쿼리를 어떻게 써줘야하나요? 고민을 해도 답이 잘안나오네요.
 
여기서 오른쪽디비필드는 wr_id 이고 각각의 첨부파일필드는 bf_no 로 되어있습니다.
 
현재는 왼쪽메뉴에 첨부파일을 1개만 등록하면 잘나옵니다. 하지만 2개이상만 등록하면
 
안됩니다. 쿼리문이나 어떻게 해야할지를 부탁드려봅니다.
 
 
<파일내용>
 

<html>
<title>로체디자인</title>
<link href="./portfolio.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {color: #0C7DF1}
.style2 {color: #FFFFFF}
-->
</style>
<body>
<table width="100%" height="100%"  border="0" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td colspan="2" align="center" valign="middle"><table width="938" height="652" border="0" cellpadding="0" cellspacing="0" bgcolor="0c1723">
      <tr>
        <td width="216" valign="top" class="line_all"> 
<!-- 내용1 왼쪽 메뉴 -->
     
<table width="167"  border="0" cellspacing="0" cellpadding="0" style="margin-left:26px; margin-right:24px; margin-top:22px;">
    <tr>
    <td><!=== 제목 타이틀 이미지 ===>
 <img src='http://www.lhotse-design.co.kr/bbs/image/l_menu1.gif'>
 </td>
  </tr> 
  <tr>
    <td><img src="image/l_menu2_01.gif" width="167" height="24" style="margin-bottom:16px;"></td>
  </tr>
  <!============= 페이지 ===============>
  <tr>
    <td height="20" align="right" valign="top">
 <table  border="0" cellspacing="0" cellpadding="0" style="margin-right:2px; margin-top:6px;" width='50'>
        <tr>
<td width='180' align='center'><font color='#D30707'><strong>1</strong></font>
        </tr>
  
      </table></td>
  </tr>
   <!============= 페이지 ===============>
  <tr>
    <td align="center" valign="top" bgcolor="#101F2C"><table width="161"  border="0" cellpadding="0" cellspacing="0" style="margin-top:4px;" height="100%">
  <tr><td height='20' valign='top' bgcolor='#283642' class='style1' align=center>
<!-- 왼쪽 메뉴들어가는곳-->
<?
     include("./dbconfig.php");
  $database = mysql_connect($mysql_host, $mysql_user, $mysql_password);
  mysql_select_db($mysql_db, $database);
  $query = mysql_query("SELECT * from g4_write_portfolio where ca_name = 'medical' "); 
  while( $row=mysql_fetch_array($query)) {
   $wr_id = $row[wr_id];
   echo " <A HREF='./pot.php?select_wr_id=$wr_id'>$row[wr_subject]</A> <br>";

  }
 ?>
 
 </table> </td>
  </tr>
<tr><td><a href='./pot_office.php'><img src='image/l_menu2_02.gif' width='167' height='22' border='0'></a></td></tr><tr><td><a href='./pot_hair.php'><img src='image/l_menu2_03.gif' width='167' height='22' border='0'></a></td></tr><tr><td><a href='pot_comm.php'><img src='image/l_menu2_04.gif' width='167' height='22' border='0'></a></td></tr><tr><td><a href='pot_hou.php'><img src='image/l_menu2_05.gif' width='167' height='22' border='0'></a></td></tr>
</table>
       </td>
    <!-- //내용1 왼쪽 메뉴 -->
        <td valign="top" class="line_brt"><table width="100%"  border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td valign=top><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td height="61" align="right" valign="top">
                    <!-- 내용2 닫기버튼 -->
     <table width="24"  border="0" cellpadding="0" cellspacing="0" style="margin-right:20px; margin-top:20px;">
                        <tr>
                          <td width="14"><a href="#"><img src="http://lhotse-design.co.kr/bbs/image/_.gif" width="10" height="10" border="0"></a></td>
                          <td><a href="JavaScript:window.close();" target="_self"><img src="http://lhotse-design.co.kr/bbs/image/x.gif" width="10" height="10" border="0"></a></td>
                        </tr>
                    </table>
                    <!-- //내용2 닫기버튼 -->     </td>
                  </tr>
                  <tr>
                    <td height="477" align="center" valign=top>
                    <!-- 내용3 이미지 -->
                    <table width="697" height="477" border="0" cellpadding="0" cellspacing="0">
                      <tr>
                        <td align="center" valign="top"><table width="696" height="476" border="0" cellpadding="0" cellspacing="0">
                          <tr>
                            <td align="center" valign="top">
       <?
       
       $query = mysql_query("SELECT * from g4_board_file where wr_id = '$select_wr_id'"); 
         while( $row1=mysql_fetch_array($query)) {
          
          echo "<img src=http://lhotse-design.co.kr/bbs/data/file/portfolio/$row1[bf_file]><br>";
          
         }
       ?>
</td>
                          </tr>
                        </table></td>
                      </tr>
                    </table>                   
                    <!-- //내용3 이미지 -->
     </td>
                  </tr>
              </table></td>
            </tr>
            <tr>
              <td height="113" align="right" valign="top">
                    <!-- 내용4 이미지 넘어가는 버튼 -->
           <table width="320" height="20"  border="0" cellpadding="0" cellspacing="0" style="margin-right:12px; margin-top:10px;">
                  <tr>
                    <td><img src="http://lhotse-design.co.kr/bbs/image/other_p.gif" width="106" height="17"></td>
                    <td bgcolor="#1A2835"><table width="80%"  border="0" cellspacing="0" cellpadding="0" style="margin-left:6px; margin-right:6px;">
                        <tr align="center">

     
        <td width='40'><a href='' target='_self'><img src='http://lhotse-design.co.kr/bbs/image/1.gif' width='10' height='12' border='0'></a></td><td width='40'><a href='#' target='_self'><img src='http://lhotse-design.co.kr/bbs/image/2.gif' width='10' height='12' border='0'></a></td><td width='40'><a href='#' target='_self'><img src='http://lhotse-design.co.kr/bbs/image/3.gif' width='10' height='12' border='0'></a></td><td width='40'><a href='#' target='_self'><img src='http://lhotse-design.co.kr/bbs/image/4.gif' width='10' height='12' border='0'></a></td><td width='40'><a href='#' target='_self'><img src='http://lhotse-design.co.kr/bbs/image/5.gif' width='10' height='12' border='0'></a></td><td width='40'><a href='#' target='_self'><img src='http://lhotse-design.co.kr/bbs/image/6.gif' width='10' height='12' border='0'></a></td><td width='40'><a href='#' target='_self'><img src='http://lhotse-design.co.kr/bbs/image/7.gif' width='10' height='12' border='0'></a></td><td width='40'><a href='#' target='_self'><img src='http://lhotse-design.co.kr/bbs/image/8.gif' width='10' height='12' border='0'></a></td>
                       
                        </tr>
                    </table></td>
                  </tr>
              </table>
                <!-- //내용4 이미지 넘어가는 버튼 -->     </td>
            </tr>
        </table></td>
      </tr>
    </table> </td>
  </tr>
</table>
</body>
</html>
 
 
<파일내용마침>

댓글 전체

$bo_table ='sub4_7';//게시판명
$wr_id = '2';//글번호
//파일명 1개만 가져오기 asc 1번파일 desc 마지막파일
$sql = " select bf_file from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '$wr_id' order by bf_no asc limit 1";
$result = sql_query($sql);
$row = sql_fetch_array($result);
$image = $row[bf_file];//파일명
echo "<img src='$g4[path]/data/filem/$bo_table/$image'><br>";
답변감사드립니다. 한가지만 더 여쭤봐도 될런지요. 첨부파일아래 숫자를 클릭했을때 첨부파일이 순서대로 나오게 하려면 어떻게 해야하나요?
get 나 폼 전송 방식으로 불러올 첨부 파일의 번호를 넘겨주고 아래처럼 불러내야 합니다.

$sql = " select bf_file from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '$wr_id' and bf_no ='넘겨준번호' ";
전체 66,554 |RSS
그누4 질문답변 내용 검색

회원로그인

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