That might work, but only if it absolutly had to. Your best bet is to drill straight up through the center of the board into the rail. Do this when it is attached to the wood with a vise grip or something. Drill the hole all the way in to and through th PVC. You can then either use lag screws, big ass deck screws, or bolts of it is at the very end of the pipe. I hope this helps, I've done it about a million times so I can do diagrams or pics if you want.