wii4life, you can get a switch to work with your ps3 to connect online provided the switch itself is actually connected to a device that is already connected to the internet (either be a router or a pc). A switch is just a device which allows data packets within a network to be transmitted to numeourous devices accordingly but without a a stand alone a router or a pc routing internet data packets, connecting a ps3 to a switch wont get you online.
As people already mentioned, getting a router is the easiest way to connect to the internet withouthaving to have a pc constantly turned on to access the internet for your ps3. Alot of routers these days come with a 4 port switch built in, saving you alot of time and effort. It is through this you can go ONLINE on any device without needing an additional switch.
Alternatively, you can also set up a pc to handle all DHCP/routing capabilities tothe internet for any devices that needs to go ONLINE, it is then you will need a switch to allow other devices to connect to your pc to gain access.
What model and brand of router do you have?
What seems to be the problem with it?