Do I use the same type of glue for both PVC and CPVC?

No, CPVC requires a special solvent cement that is different from cement used for other types of plastic pipe.