DB::update("update problems set title = '".DB::escape($data['title'])."' where id = {$problem['id']}");
DB::update("update problems_contents set statement = '".DB::escape($data['content'])."', statement_md = '".DB::escape($data['content_md'])."' where id = {$problem['id']}");
if($data['tags']!==$problem_tags){
DB::delete("delete from problems_tags where problem_id = {$problem['id']}");
foreach($data['tags']as$tag){
DB::insert("insert into problems_tags (problem_id, tag) values ({$problem['id']}, '".DB::escape($tag)."')");
}
}
if($data['is_hidden']!=$problem['is_hidden']){
DB::update("update problems set is_hidden = {$data['is_hidden']} where id = {$problem['id']}");
DB::update("update submissions set is_hidden = {$data['is_hidden']} where problem_id = {$problem['id']}");
DB::update("update hacks set is_hidden = {$data['is_hidden']} where problem_id = {$problem['id']}");