You don't use the dissolved salt in electrolysis, since as you said, the water would electrolyse out of the solution. No, what you do is that you electrolyse the molten salt (i.e. get the salt, dessicate it, melt it, and electrolyse). When you electrolyse NaCl, for example, you get Na deposited around the anode and Cl2 around the cathode (unless I've mixed them up somehow...)