/adm/shop/orderform.php 에서 g5_shop_item 여분필드 불러오는 방법을 찾고 있습니다.
본문
관리자가 itemform.php(상품입력)에 여분필드를 사용하여 기본정보하나를 추가했습니다.(ex 납품사)
쇼핑몰관리/주문내역/보기/orderform.php 에서 다른 테이블의 (g5_shop_item_table) 여분필드를 어떤식으로 호출해야 하는지요?
<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를 뿌려줘야 하지 않을까요?
그냥 쿼리만 쪼금 알면 쉬울꺼 같은데요 ^^
제가 알려주신 방법으로 예제를 잠시 만들어봤습니다.
상단에 몇가지 문제가 있었습니다.
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>
!-->