maddsquabbles, for your particular application, glue will not work. The first problem is that although superglue will set under water, actually dispensing it underwater is difficult at best. Contact with water will greatly speed up the setting process, and you're probably just going to end up with superglue stuck in the tube. Second, superglue is not very effective on mushroom corals. Heap's description of stapling a bugger to a wall is probably a good one. Mushrooms have a slime layer that is going to prevent the glue from taking hold.
About the only reliable way to attach a mushroom is to use something to physically hold it in place while it attaches naturally (like a rubber band). Of course, if your mushroom is detaching, it sounds like there's something else going on, and you very well may not be able to get it to reattach.