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

New.php에서 게시물 일괄변경 채택완료

카세구 3년 전 조회 1,906

New.php에서 선택삭제 기능을 이용해서

 

선택된 게시글들의 분류필드 wr_10에 특정값을 넣어주고싶어서

new_delete.php를 만지다보면 될거같아서 해보는데,

생각보다 쉽지 않은것같습니다. 어떻게 넣어야 해결이 될까요??

 

현재 수정한 소스는 이렇습니다.

 

 

//print_r2($_POST); exit;

if ($is_admin != 'super')     alert("최고관리자만 접근이 가능합니다.");

$board = array('bo_table'=>''); $save_bo_table = array(); $save_wr_id = array(); $count_chk_bn_id = (isset($_POST['chk_bn_id']) && is_array($_POST['chk_bn_id'])) ? count($_POST['chk_bn_id']) : 0;

for($i=0;$i<$count_chk_bn_id;$i++) {     // 실제 번호를 넘김     $k = isset($_POST['chk_bn_id'][$i]) ? (int) $_POST['chk_bn_id'][$i] : 0;

    $bo_table = isset($_POST['bo_table'][$k]) ? preg_replace('/[^a-z0-9_]/i', '', $_POST['bo_table'][$k]) : '';     $wr_id    = isset($_POST['wr_id'][$k]) ? preg_replace('/[^0-9]/i', '', $_POST['wr_id'][$k]) : 0;          $count_write = $count_comment = 0;

    $save_bo_table[$i] = $bo_table;     $save_wr_id[$i] = $wr_id;

    $write_table = $g5['write_prefix'].$bo_table;

    if ($board['bo_table'] != $bo_table)         $board = sql_fetch(" select bo_subject, bo_write_point, bo_comment_point, bo_notice from {$g5['board_table']} where bo_table = '$bo_table' ");

    $write = get_write($write_table, $wr_id);     if (!$write) continue;

    // 원글 삭제     sql_query(" update {$g5['board_table']} set wr_10 = '' where  wr_id = '{$write['wr_id']}' ` "); }

goto_url("new.php?sfl=$sfl&stx=$stx&page=$page");

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

답변 1개

채택된 답변
+20 포인트
3년 전

sql_query(" update {$g5['board_table']} set wr_10 = '' where  wr_id = '{$write['wr_id']}' ` ");

->

sql_query(" update {$write_table} set wr_10 = '' where  wr_id = '{$write['wr_id']}' ");

 

로그인 후 평가할 수 있습니다

답변에 대한 댓글 2개

카세구
3년 전
앗...감도 안잡혀서 이것저것 해봤던게 생각보다 답에 근접했었네요..

감사합니다!
카세구
3년 전
사랑합니다

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

답변을 작성하려면 로그인이 필요합니다.

로그인