Drill a hole all the way through both sides of the pvc, use one of these
And clamp it to your wood do this about every 3 ft, they are really good and the pipes dont shift.
to make a flat bar style rail with more than one pvc pipe do the same thing but line up all the holes and get bigger hose clamps. This works really well because the top is completly smooeth with no holes
BROKE, my ankles are broken, i have broken ankles! ahhhhhhhh - tanner hall