<?

        $sql = " select wr_subject, wr_1 from g4_write_books 
                  where wr_9 = '$wr_subject' ";
        $row = sql_fetch($sql);

        $sql2 = " select wr_subject from g4_write_members 
                  where wr_9 = '$wr_1' ";
        $row2 = sql_fetch($sql2);

    sql_query(" update $write_table set  wr_subject ='$row[wr_subject]', wr_2 = '$row2[wr_subject]', wr_3 = '1', wr_1 = '$row[wr_1]', wr_9 = '$wr_subject'   where wr_id = '$wr_id' ");

//  if($action == "r")  sql_query(" update $write_table set   wr_3 = '2'  where wr_id = '$wr_id' ");				   
?>