채택완료

admin/index.php 에 특정게시판 글 불러올려면..

2016-11-02 (수) 15:27:15 4,170

<section>

    <h2>최근상담신청</h2>

<div class="tbl_head01 tbl_wrap">

    <table>

    <caption>최근상담신청</caption>

    <thead>

    <tr>

<th scope="col">이름</th>

<th scope="col">전화번호</th>

<th scope="col">아이피</th>

<th scope="col">관심상품구분</th>

<th scope="col">희망금액</th>

<th scope="col">상태</th>

<th scope="col">상담사</th>

        <th scope="col">접수일</th>

    </tr>

    </thead>

    <tbody>

    <?php

    $k = 0;

    for ($i=0; $row=sql_fetch_array($result); $i++) {

$row['wr_subject'] = conv_subject($row['wr_subject'], 40, '…');

// 당일인 경우 시간으로 표시함

$row['datetime'] = substr($row['wr_datetime'],0,10);

$row['datetime2'] = $row['wr_datetime'];

if ($row['datetime'] == G5_TIME_YMD)

$row['datetime2'] = substr($row['datetime2'],11,5);

else

$row['datetime2'] = substr($row['datetime2'],5,5);

        $list_num = ($total_count - ($page - 1) * $list_page_rows) - $k;

        $bg = 'bg'.($i%2);

    ?>

    <tr class="<?php echo $bg; ?>">

<td class="td_wr6"><?php echo $row['wr_6'] ?></td>

<td class="td_wr7"><?php echo $row['wr_7'] ?>-<?php echo $row['wr_16'] ?>-<?php echo $row['wr_17'] ?></td>

<td class="td_wrip"><?php echo $row['wr_ip'] ?></td>

        <td class="td_wr8"><?php echo $row['wr_8'] ?></td>

        <td class="td_wr9"><?php echo $row['wr_9'] ?> 만원</td>

<td class="td_wr4"><?php echo $row['wr_4'] ? $row['wr_4'] : '상담대기'; ?></td>

<td class="td_wr5"><?php echo $row['wr_5'] ?></td>

        <td class="td_subject" style="display:none;">

<?if ($is_category && $row['ca_name']) { echo "[".$row['ca_name']."]"; } ?>

<?php echo $row['wr_subject'] ?>

</td>

        <td class="td_date">

            <?php echo $row['wr_datetime'] ?>

        </td>

        <td class="td_mngsmall">

            <a href="./counsel_form.php?w=u&amp;wr_id=<?php echo $row['wr_id']; ?>&amp;<?php echo $qstr; ?>"><span class="sound_only"><?php echo get_text($row['wr_subject']); ?> </span>수정</a>

        </td>

    </tr>

    <?php

        $k++;

    }

    if ($i == 0) {

        echo '<tr><td colspan="11" class="empty_table">자료가 없습니다.</td></tr>';

    }

    ?>

    </tbody>

    </table>

</div>

</section>

이렇게되어있는데 데이터가 불러지지 않아요 자료가 있는데 자료가없습니다로 나옵니다~ㅠ 

도와주세요 

답변 2개 / 댓글 2개

채택된 답변
+20 포인트

$result 로 불러올 결과물의 쿼리코드를 올려주셔야 하겠네요.

쿼리가 잘못되어 데이터를 읽어오지 못하는 상태입니다. 

답변에 대한 댓글 2개

$sql = " select a.*, b.bo_subject, c.gr_subject, c.gr_id {$sql_common} {$sql_order} limit {$new_write_rows} ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)

요런거인가여 특정게시판 글 불러오는 코드 알려주실수없나요?//
$sql_common, $sql_order, $new_write_rows 에 해당하는 값도 같이 올려주셔야 완전한 쿼리를 확인할 수 있습니다.

latest를 쓰면 됩니다..

답변을 작성하려면 로그인이 필요합니다.