테스트 사이트 - 개발 중인 베타 버전입니다

후기랑 상품문의 최신글에서 내글만 보여지게 하려면 어떻게 해야 하나요?

· 11년 전 · 8 · 4

http://www.seolremtv.com/wanee/wanee.php

 

http://www.seolremtv.com/wanee/wanee2.php

 

이구요.

 

http://www.seolremtv.com/wanee/bbs/new2.php

 

일반 게시판에서의 최근게시물 내글보기는

 

상단에

 

$mb_id = $_GET['mb_id'];
if(!$mb_id){
$mb_id = $_POST['mb_id'];
if(!$mb_id){
$mb_id = $member[mb_id];
}
} ​

 

넣어서 되었는데, 영카트쪽 게시판 최신글에서는 넣어도 내글만 보여지지 않고 전체가 보여지네요. ㅜㅜ

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기

댓글 4개

wanee.php 의 코드에

$sql_common = " from $g4[yc4_item_ps_table] where is_confirm = '1' ";
if ($is_member) {
$sql_common .= " where mb_id = '$member[mb_id]' ";
}
$sql_order = " order by is_time desc ";

이런 코드를 넣어 봤는데 이런걸 원하시는 것인지요?
test1 / 1234

로 로그인 하면, test1 로 로그인한 글만 보여지게 하고 싶어요. (로그인 후 본인글만 보이도록이요)

http://www.seolremtv.com/wanee/bbs/new2.php (여기서는 로그인한 후 본인글만 보여지고 있어요)



헌데, 로그인하면

select count(*) as cnt from yc4_item_ps where is_confirm = '1' where mb_id = 'test1'

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 'where mb_id = 'test1'' at line 1

error file : /wanee/wanee.php

이런 에러가 나오네요.

어떻게 수정해야 하나요?
where 가 두번 들어 갔습니다.

if ($is_member) {
$sql_common .= " and mb_id = '$member[mb_id]' ";
}

와 같이 수정해 보시기 바랍니다.
http://www.seolremtv.com/wanee/wanee.php
이쪽 후기 부분은 알려주신 대로 처리하니 내글만 보여지게 되는것 성공했습니다.

http://www.seolremtv.com/wanee/wanee2.php
이쪽 구매문의쪽에도 상단에 똑같이 넣었는데 내글만 보여지지 않고 전체가 보여지는데,

이쪽 부분은 어떻게 수정해야 하나요?