New.php에서 게시물 일괄변경

New.php에서 게시물 일괄변경

QA

New.php에서 게시물 일괄변경

본문

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

 

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

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

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

 

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

 

 

<?php
include_once('./_common.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

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']}' ");

 

답변을 작성하시기 전에 로그인 해주세요.
전체 20
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT