Originally Posted by KevinF
If the crank-arm fixing bolt was loose enough to allow the crank arm to come right off during a ride, then you've probably ruined the crank-arm / bottom-bracket interface as well. In other words, you might be able to put the crank-arm back on, but you'll never get it properly tight again -- it'll just keep working its way loose. That's probably what the "knocking" sound you refer to is -- you're flexing the crank-arm against the bottom bracket spindle and ruining it some more.
If I were you, I'd toss the crank arm and bottom bracket and install new ones.