Toilet flange bolts or tee bolts as they are commonly called are in my opinion very poorly designed. They work on compression, when the nut is tightened the flanged end of the bolt pulls against the toilet flange keeping it in place.
This works great when the bolts are new. However, when they are old and corroded, they can seize up, causing them to spin and not tighten. Take a pair of pliers and hold the threaded portion of the bolt and use a wrench to tighten the nut. Hopefully it tightens and you have solved your problem. If no threads are showing try to tighten it with just the wrench. If it spins you will have to replace the bolts.
Assuming the tightening is successful, tighten both sides until the toilet is secure and not loose. Be certain that the toilet is not leaking. You may want to wait a day or two to make sure. No leaks, good. Use a silicone caulk around the bottom of the toilet to keep water from the floor out. Replace the caps for the tee bolts and you are done. Good Job! That's all there was to this toilet flange repair.