Goto mIRC Options -> Connect -> Perform:
Check the "Enable perform on connect" box.
Type join #channel1 into the large text area. This will make you join #channel1 whenever you connect to a server. To add a channel you can either:
1. Add another join command or
2. Change the first one to join #channel1,#channel2.
The second option is not supported by all IRC servers, but it lowers the chance of you flooding yourself of the server.