I was trying to record and play audio by connecting a PC to the PA system. However, once I plugged in the two separate cables, the PA system started emitting a constant high-pitched noise that had reached to its peak.
This sounds like a classic case of electronic feedback. What happens is that the sound from the board is being fed to the input of the PC, which sends it right back out the speaker output into the board. The board then sends it right back out to the PC, and you have a loop.
One way to deal with this is to ensure that the input to the PC is muted to the output of the PC. Exactly how to do this will differ depending on the software used. There might be a "monitor" switch in the software. Turn this option off.
Another option is to ensure that the input to the mixer is NOT routed to the output feeding the PC. If you are using the "tape out" jacks on the mixer, you won't be able to do this. Depending on the mixer, there may be other connection options.
If you can tell us what software you are using for recording, someone here will probably be able to help you. Also tell us what mixer you are using, and which of the mixer's outputs & inputs you have the PC connected to.