로그인을 한 상태에서 장바구니에 상품을 담은후 로그아웃을 하면 장바구니에 상품이 사라지는 현상때문에
알려주신대로 수정했는데 장바구니 페이지에서 에러가 나네요.
insert yc4_cart set on_uid = '73e82af5cbfcdb87fbe3056e2995b959', it_id = '197', it_opt1 = 'GT.DOA-P704-AA', it_opt2 = '', it_opt3 = '', it_opt4 = '', it_opt5 = '', it_opt6 = '', ct_status = '�눥�븨', ct_amount = '462500', ct_point = '0', ct_point_use = '0', ct_stock_use = '0', ct_qty = '1', ct_time = '2014-06-23 14:00:56', ct_ip = '182.212.15.123', ct_direct = '0' mb_no = '11'
1064 : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mb_no = '11'' at line 19
error file : /shop/cartupdate.php
라고 화면에 나옵니다.
댓글 8개
insert yc4_cart set on_uid = '73e82af5cbfcdb87fbe3056e2995b959', it_id = '3602', it_opt1 = '93Q;+2200', it_opt2 = '', it_opt3 = '', it_opt4 = '', it_opt5 = '', it_opt6 = '', ct_status = '�눥�븨', ct_amount = '16500', ct_point = '0', ct_point_use = '0', ct_stock_use = '0', ct_qty = '1', ct_time = '2014-06-23 16:09:34', ct_ip = '182.212.15.123', ct_direct = '0' ,mb_no = '11'
1054 : Unknown column 'mb_no' in 'field list'
error file : /shop/cartupdate.php
라고 오류가 나네요.
http://sir.co.kr/bbs/board.php?bo_table=yc4_tiptech&wr_id=1397 의 팁이 제대로 적용이 되어 있지 않았습니다.
"<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
// 자신만의 코드를 넣어주세요.
$tmp_on_uid = get_session("ss_on_uid");
// 비회원으로 장바구니에 담았던 쇼핑 데이터를 로그인된 회원의 것으로 변경한다.
$sql = " update $g4[yc4_cart_table] set mb_no = '$mb[mb_no]' where on_uid = '$tmp_on_uid' and ct_status = '쇼핑' ";
$result = sql_query($sql, false);
// 에러가 있다면 mb_no 필드를 생성한다.
if (!$result) {
sql_query(" ALTER TABLE `$g4[yc4_cart_table]` ADD `mb_no` INT NOT NULL ");
sql_query(" ALTER TABLE `$g4[yc4_cart_table]` ADD INDEX ( `mb_no` ) ");
}
// 이미 회원으로 담아 놓았던 쇼핑 데이터를 현재 장바구니 키로 변경한다.
$sql = " update $g4[yc4_cart_table] set on_uid = '$tmp_on_uid' where mb_no = '$mb[mb_no]' and ct_status = '쇼핑' ";
sql_query($sql);
?>
게시글 목록
| 번호 | 제목 |
|---|---|
| 55298 | |
| 55295 | |
| 55294 | |
| 55292 | |
| 55287 | |
| 55285 | |
| 55280 | |
| 55276 | |
| 55274 | |
| 55267 | |
| 55266 | |
| 55259 | |
| 55256 | |
| 55254 | |
| 55247 | |
| 55240 | |
| 55238 | |
| 55237 | |
| 55233 | |
| 55229 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기