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

2017-02-16 (목) 02:58:44 4,158

관리자가 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개 / 댓글 1개

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

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

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

Copy
<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>

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

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


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

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

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

답변에 대한 댓글 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> //추가된 여분필드
체크좀 부탁드립니다.

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