답변 좀 부탁드리겠습니다...mysql 관련입니다. 정보
답변 좀 부탁드리겠습니다...mysql 관련입니다.본문
latest.lib.php 파일을 수정해서 그룹 최신글 중에 board_new_table 에
wr_1 = '1'이 들어가 있는 최신글만 불러오게 할려고 합니다.
$sql = "select bo_table, wr_id from $g4[board_new_table]
where wr_id = wr_parent and $qry_bo_search and wr_1='1' order by bn_datetime desc LIMIT 0,$rows";
현재 latest.lib.php 파일은 이렇게 해서 완료 된 상태이고
write.skin.php에서 글을 쓸때 체크박스에 체크를 하면 wr_1 값에 "1" 이 들어가게 했습니다.
문제는
g4_write_table 에 wr_1 값에 들어가있는 "1" 을
g4_board_new 에 똑같이 wr_1 값에 "1" 이 업데이트 되도록 할려고 합니다.
그래서 g4_board_new 테이블에 wr_1 필드를 추가해주었고
write_update.skin.php 파일에
if($w=='' || $w == 'u') { //글작성이나 수정시
@sql_query(" update $g4[board_new_table] set wr_1 = '$wr_1' where bo_table = '$bo_table' and wr_id = '$wr_id' and wr_parent = '$wr_id' "); //
}
이렇게 했는데
g4_board_new 테이블에 wr_1 값은 아직도 null 이네요
틀린 부분이나 수정 좀 부탁드리겠습니다.
wr_1 = '1'이 들어가 있는 최신글만 불러오게 할려고 합니다.
$sql = "select bo_table, wr_id from $g4[board_new_table]
where wr_id = wr_parent and $qry_bo_search and wr_1='1' order by bn_datetime desc LIMIT 0,$rows";
현재 latest.lib.php 파일은 이렇게 해서 완료 된 상태이고
write.skin.php에서 글을 쓸때 체크박스에 체크를 하면 wr_1 값에 "1" 이 들어가게 했습니다.
문제는
g4_write_table 에 wr_1 값에 들어가있는 "1" 을
g4_board_new 에 똑같이 wr_1 값에 "1" 이 업데이트 되도록 할려고 합니다.
그래서 g4_board_new 테이블에 wr_1 필드를 추가해주었고
write_update.skin.php 파일에
if($w=='' || $w == 'u') { //글작성이나 수정시
@sql_query(" update $g4[board_new_table] set wr_1 = '$wr_1' where bo_table = '$bo_table' and wr_id = '$wr_id' and wr_parent = '$wr_id' "); //
}
이렇게 했는데
g4_board_new 테이블에 wr_1 값은 아직도 null 이네요
틀린 부분이나 수정 좀 부탁드리겠습니다.
댓글 전체
$wr_1 값이 나오는지 먼저 확인해 보시는것이,,
g4_write_table 안에 wr_1 값을 얘기하시는건가요?
잘 나옵니다
if($w=='' || $w == 'u') { //글작성이나 수정시
@sql_query(" update $g4[board_new_table] set wr_1 = '$wr_1' where bo_table = '$bo_table' and wr_id = '$wr_id' and wr_parent = '$wr_id' "); //
}
이 쿼리문이 틀렸나요?
어떻게해야 g4_board_new 테이블 안에 wr_1 값이 1이 들어갈까요...
잘 나옵니다
if($w=='' || $w == 'u') { //글작성이나 수정시
@sql_query(" update $g4[board_new_table] set wr_1 = '$wr_1' where bo_table = '$bo_table' and wr_id = '$wr_id' and wr_parent = '$wr_id' "); //
}
이 쿼리문이 틀렸나요?
어떻게해야 g4_board_new 테이블 안에 wr_1 값이 1이 들어갈까요...
if($w=='' || $w == 'u') { //글작성이나 수정시
@sql_query(" update $g4[board_new_table] set wr_1 = '$wr_1' where bo_table = '$bo_table' and wr_id = '$wr_id' and wr_parent = '$wr_id' "); //
}
이부분은 문제없어 보입니다만 if문은 필요없고 wr_parent = '$wr_id' 도 필요없겠군요
@sql_query(" update $g4[board_new_table] set wr_1 = '$wr_1' where bo_table = '$bo_table' and wr_id= '$wr_id' ");
-----------------------------
$sql = "select bo_table, wr_id from $g4[board_new_table]
where wr_id = wr_parent and $qry_bo_search and wr_1='1' order by bn_datetime desc LIMIT 0,$rows";
이 부분도 wr_id = wr_parent 는 필요없습니다(wr_1에 입력될 때 조건에 따라 입력되어있으니까요)
$qry_bo_search 코드만 맞게 되어있다면 추출도 문제 없겠는걸요?
$sql = "select bo_table, wr_id from $g4[board_new_table]
where $qry_bo_search and wr_1='1' order by bn_datetime desc LIMIT 0,$rows";
@sql_query(" update $g4[board_new_table] set wr_1 = '$wr_1' where bo_table = '$bo_table' and wr_id = '$wr_id' and wr_parent = '$wr_id' "); //
}
이부분은 문제없어 보입니다만 if문은 필요없고 wr_parent = '$wr_id' 도 필요없겠군요
@sql_query(" update $g4[board_new_table] set wr_1 = '$wr_1' where bo_table = '$bo_table' and wr_id= '$wr_id' ");
-----------------------------
$sql = "select bo_table, wr_id from $g4[board_new_table]
where wr_id = wr_parent and $qry_bo_search and wr_1='1' order by bn_datetime desc LIMIT 0,$rows";
이 부분도 wr_id = wr_parent 는 필요없습니다(wr_1에 입력될 때 조건에 따라 입력되어있으니까요)
$qry_bo_search 코드만 맞게 되어있다면 추출도 문제 없겠는걸요?
$sql = "select bo_table, wr_id from $g4[board_new_table]
where $qry_bo_search and wr_1='1' order by bn_datetime desc LIMIT 0,$rows";
아.. 균이님 답변만을 기다렸습니다 ㅎㅎㅎㅎ
정말정말 감사합니다 오늘도 역시 잘되네요
매번 정말 감사해요 ㅎㅎ 3일동안 안되던건데
if문 없애고 위에다가 넣으니 되네요 ㅎㅎ
정말정말 감사합니다 오늘도 역시 잘되네요
매번 정말 감사해요 ㅎㅎ 3일동안 안되던건데
if문 없애고 위에다가 넣으니 되네요 ㅎㅎ