/adm/shop/orderform.php 에서 g5_shop_item 여분필드 불러오는 방법을 찾고 있습니다.

/adm/shop/orderform.php 에서 g5_shop_item 여분필드 불러오는 방법을 찾고 있습니다.

QA

/adm/shop/orderform.php 에서 g5_shop_item 여분필드 불러오는 방법을 찾고 있습니다.

본문

관리자가 itemform.php(상품입력)에 여분필드를 사용하여 기본정보하나를 추가했습니다.(ex  납품사)

쇼핑몰관리/주문내역/보기/orderform.php 에서 다른 테이블의 (g5_shop_item_table) 여분필드를 어떤식으로 호출해야 하는지요? 

1abc810147505d40d3df1a34d5c241bb_1487180841_2069.gif 

 

                <td class="td_num"><?php echo number_format($opt_price); ?></td>
                <td class="td_num"><?php echo number_format($ct_price['stotal']); ?></td>
                <td class="td_num"><?php echo number_format($opt['cp_price']); ?></td>
                <td class="td_num"><?php echo number_format($ct_point['stotal']); ?></td>


                <td class="td_num"><?php echo ($row['it_1']); ?></td> //추가된 여분필드


                <td class="td_sendcost_by"><?php echo $ct_send_cost; ?></td>
                <td class="td_mngsmall"><?php echo get_yn($opt['ct_point_use']); ?></td>
                <td class="td_mngsmall"><?php echo get_yn($opt['ct_stock_use']); ?></td>

 

타 테이블 호출은 별도의 쿼리문을 추가해줘야 한다는 데 어렵습니다.  

이 질문에 댓글 쓰기 :

답변 2

우선 먼저 상단에 쿼리를  수정을 해줘야하지 않을까 생각합니다.

'it_1'란 여분 필드를 넣구싶다. 가정할경우


select it_1 from g5_item <-- 이런식으로 선언을 해주시고

아래쪽에서 it_1를 뿌려줘야 하지 않을까요?

그냥 쿼리만 쪼금 알면 쉬울꺼 같은데요 ^^

 

 

orderform.php에

 

  $sql = " select it_1 from {$g5['g5_shop_item_table']}  where it_id = '$it_id' ";
    $row = sql_fetch($sql);

이렇게 해보고

 

  $sql = " select it_1 from {$g5['g5_shop_item_table']}  where it_id = '$it_id' ";
  $row = sql_quary($sql);
  $result = sql_fetch_array($row);

 

아래는

<td class="td_num"><?php echo ($row['it_1']); ?></td> //추가된 여분필드
체크좀 부탁드립니다.

제가 알려주신 방법으로 예제를 잠시 만들어봤습니다.

상단에 몇가지 문제가 있었습니다.

for문을 쓰던 whiel문을 쓰던 해서 아래처럼 활용하시면 될겁니다.

 


<tr>
<?
$sql = " select it_1 from {$g5['g5_shop_item_table']}  where it_id = '$it_id' "; 
$result= sql_quary($sql);  

 
while ($row = sql_fetch_array($result))
{
?>
<td class="td_num"><?php echo ($row['it_1']); ?></td>
<?
}
?>
</tr>

 

 

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

회원로그인

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