따로 디렉토리 생성해서 페이지를 작성하는데 sql문 오류 사용법

따로 디렉토리 생성해서 페이지를 작성하는데 sql문 오류 사용법

QA

따로 디렉토리 생성해서 페이지를 작성하는데 sql문 오류 사용법

본문

임의로 100 이라는 bo_table 게시판을 생성했습니다.

다른 디렉토리를 임의로 생성해서 사용하는데요.

예를들어 /korea/seoul/seoul.php
라는 파일을 생성했다고 하면, 상단에 common.php 파일을 경로에 맞게 include 하였습니다.

2건의 값을 가져오려고 하는데

select wr_content from g5_write_ where wr_id = ''

1146 : Table 'enjoytaiwan.g5_write_' doesn't exist

error file : /enjoytaiwan/taiwan/taipei/main.php


위와 같은 오류가 발생합닌다. 소스는 웹진형 소스를 참고해서 
대충만 임시로 카피했습니다.

        <table>
        <caption><?php echo $board['bo_subject'] ?>목록</caption>
        <tbody>
        <?php
        // for ($i=0; $i<count($list); $i++) {
			for ($i=0; $i<2; $i++) {
         ?>
        <tr class="<?php if ($list[$i]['is_notice']) echo "bo_notice"; ?>">



			<td>

                <?php
				$thumb = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $board['bo_gallery_width'], $board['bo_gallery_height']);

				if($thumb['src']) {
					$img_content = '<div style="float:left;width:'.$board['bo_gallery_width'].'px;height:'.$board['bo_gallery_height'].'px;padding-right:20px"><a href="'.$list[$i]['href'].'"><img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" width="'.$board['bo_gallery_width'].'" height="'.$board['bo_gallery_height'].'" style="border:1px solid #ddd"></a></div>';
                } else {
					$img_content = '';
                }

                echo $img_content;
                ?>


			
			</td>

            <td class="td_subject">
                <?php
                echo $list[$i]['icon_reply'];
                if ($is_category && $list[$i]['ca_name']) {
                 ?>
                <a href="<?php echo $list[$i]['ca_name_href'] ?>" class="bo_cate_link"><?php echo $list[$i]['ca_name'] ?></a>
                <?php } ?>

                <a href="<?php echo $list[$i]['href'] ?>">
                    <?php echo "[".$list[$i]['subject']."]" ?> <?php echo $list[$i]['datetime2'] ?><br />
                    <?php if ($list[$i]['comment_cnt']) { ?><span class="sound_only">댓글</span><?php echo $list[$i]['comment_cnt']; ?><span class="sound_only">개</span><?php } ?>
					<?php echo cut_str(get_text(strip_tags($list[$i]['wr_content'])), 100, "‥")?><br />
					<?php echo $list[$i]['name'] ?>
                </a>

 
            </td>

        </tr>
        <?php } ?>
        <?php if (count($list) == 0) { echo '<tr><td colspan="'.$colspan.'" class="empty_table">게시물이 없습니다.</td></tr>'; } ?>
        </tbody>
        </table>


스킨게시판에 임의로 복사해서 작성했을때는 정상적으로 출력이 되는데,
스킨을 상용할수 없고 따로 불러와야 하는 식인데, bo_table명이 없는거 같아서
$board['bo_table'] = "100";
 이라고 임시로 넣으면
오류는 표시 안되는데 아무것도 출력이 안됩니다. ;;

이 질문에 댓글 쓰기 :

답변 3

select * from g5_write_100 order by wr_id limit 0,2
 
for ($i=0; $i<count($list); $i++) {
 
요렇게 넣어보심이........

아 히어로님 답변 감합니다.


$sql = " select * from g5_write_100 order by wr_id limit 0, 2 ";
$result = mysql_query($sql);
for ($i=0; $i<count($list); $i++) {
	$list[$i] = mysql_fetch_array($result);
}

이렇게 작성해 봤습니다.

아 다음에 출력하는 for 문위에 위처럼 배열로 넣는 식으로 작성했습니다.


select wr_content from g5_write_ where wr_id = ''

1146 : Table 'enjoytaiwan.g5_write_' doesn't exist

error file : /enjoytaiwan/taiwan/taipei/main.php

동일하게 나오네요 ;;

아 답변을 드릴려고해도 좀 평온한 심신일때 해야하는데 이것저것 하다가 답변을 다니 재정신이 아니네요 ㅡㅜ;;;;;

희안하네요......

$sql = " select * from g4_banner order by ba_id limit 0, 2 ";
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++) {
$list[$i] = $row;

print_r($row);

}

동일하게 해서 전 출력이 되는데 말이죠 ;;;;;;


Array ( [ba_id] => 1 [mb_id] => aaaaaa [ba_num] => 0 [ba_daylist] => 30 [ba_eday] => [ba_url] => http://www.monsterbox.co.kr [ba_file] => ) Array ( [ba_id] => 2 [mb_id] => aaaaaa [ba_num] => 1 [ba_daylist] => 180 [ba_eday] => [ba_url] => http://www.monsterbox.co.kr [ba_file] => )

앗 피곤하신가 보네요 ;;;;
제가 오해하게 적었네요..
타이핑하고 왜 안되지 하다가 보니까 제 오타여서 다시 수정해서 잘된다는 거에요 :)
감사합니다.
괜히 더 피로를 드려서 ;;;;

답변을 작성하시기 전에 로그인 해주세요.
전체 155
QA 내용 검색

회원로그인

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