query(" INSERT INTO wiki_artists (PageID, Body, Image, UserID, Summary, Time) VALUES ('$ArtistID', '$Body', '$Image', '$UserID', '$Summary', '".sqltime()."')"); } else { // revert $DB->query(" INSERT INTO wiki_artists (PageID, Body, Image, UserID, Summary, Time) SELECT '$ArtistID', Body, Image, '$UserID', 'Reverted to revision $RevisionID', '".sqltime()."' FROM wiki_artists WHERE RevisionID='$RevisionID'"); } $RevisionID = $DB->inserted_id(); // Update artists table (technically, we don't need the RevisionID column, but we can use it for a join which is nice and fast) $DB->query(" UPDATE artists_group SET ". (isset($VanityHouse) ? "VanityHouse='$VanityHouse'," : '') ." RevisionID='$RevisionID' WHERE ArtistID='$ArtistID'"); // There we go, all done! $Cache->delete_value('artist_'.$ArtistID); // Delete artist cache header('Location: artist.php?id='.$ArtistID); ?>