<?
$sub_menu = "100600";
include_once("./_common.php");

check_demo();

if ($is_admin != "super")
    alert("您没有管理权限");

$g4[title] = "收藏夹数据更新";
include_once("./admin.head.php");

$sql = " ALTER TABLE `g4_scrap` ADD `ms_gr` TEXT NOT NULL , ADD `ms_memo` TEXT NOT NULL , ADD `wr_mb_id` VARCHAR( 255 ) NOT NULL , ADD `wr_subject` VARCHAR( 255 ) NOT NULL , ADD `chk_alb` TINYINT NOT NULL ";
sql_query($sql, false);

$sql = " select * from $g4[scrap_table] ";
$result = sql_query($sql);

for ($i=0; $row=sql_fetch_array($result); $i++) {
    $tmp_write_table = $g4[write_prefix] . $row[bo_table];

    $sql1 = " select wr_subject, mb_id from $tmp_write_table where wr_id = '$row[wr_id]' ";
    $result1 = sql_fetch($sql1, false);
    $sql7 = " update $g4[scrap_table] set wr_mb_id = '$result1[mb_id]', wr_subject = '$result1[wr_subject]' where ms_id = '$row[ms_id]'";
    sql_query($sql7, false);
}

echo "<br>scrap UPGRADE 完成";

include_once("./admin.tail.php");
?>