int 때문인 것 같은데, 문자를 저장하려면 어떻게해야 될까요? 채택완료
orderformcartupdate.php 에서 수량을 변경하는 부분입니다.
문자를 넣고 싶은데 숫자만 저장이 됩니다.
int 때문인 것 같은데, 문자를 저장하려면 어떻게해야 되나요?
도움 부탁 드립니다. ㅜㅜ
// 수량이 변경됐다면 $ct_qty = isset($_POST['ct_qty'][$k]) ? (int) $_POST['ct_qty'][$k] : 0; if($ct['ct_qty'] != $ct_qty) { $diff_qty = $ct['ct_qty'] - $ct_qty;
// 수량변경 $sql = " update {$g5['g5_shop_cart_table']} set ct_qty = '$ct_qty' where ct_id = '$ct_id' and od_id = '$od_id' "; sql_query($sql); $mod_history .= G5_TIME_YMDHIS.' '.$ct['ct_option'].' 수량변경 '.$ct['ct_qty'].' -> '.$ct_qty."\n"; }
답변 2개
$ct_com = isset($_POST['ct_com'][$k]) ? (string) $_POST['ct_com'][$k] : '';
이게 될진 모르겠네요. ct_com 포스트 변수가 배열 맞나요?
답변에 대한 댓글 1개
댓글을 작성하려면 로그인이 필요합니다.
답변에 대한 댓글 1개
g5_shop_cart 테이블에 ct_com이란 필드를 text 타입으로 추가하여 저장하려고 해요.
$ct_com = isset($_POST['ct_com'][$k]) ? (int) $_POST['ct_com'][$k] : 0;
if($ct['ct_com'] != $ct_com) {
$diff_qty = $ct['ct_com'] - $ct_com;
$sql = " update {$g5['g5_shop_cart_table']}
set ct_com = '$ct_com'
where ct_id = '$ct_id'
and od_id = '$od_id' ";
sql_query($sql);
$mod_history .= G5_TIME_YMDHIS.' '.$ct['ct_option'].' 회사명변경 '.$ct['ct_com'].' -> '.$ct_com."\n";
}
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인