Another thing that can happen is the phone's OS slapping ".nomedia" (without the quotation marks, but with the period before nomedia) into every folder it thinks has no media to speed up the OS. It does this sometimes even if there is media, for example, after mounting and unmounting your phone. Until you dig out and delete each .nomedia system file, the phone's programs won't see your media to be able to play music or see photos. On my phone, even if the .nomedia system file is in a different directory, it will stop seeing my media! For that reason, when this happens I remove them all (the phone will put them back).
I don't know how much you know about PCs or the phone, so I am going to assume it's not much and apologize ahead of time if you find this insulting.
Because .nomedia is a system file, it is normally hidden. The easiest way to deal with this is to mount the phone to your PC, make sure your PC's folder options are set to view hidden files and folders (not system files because that refers only to PC system files), and then search your phone for .nomedia and delete all of them. You have to search your SD card separately from searching your phone. As soon as you've done that, unmount your phone and immediately tell the phone to do a media scan. The phone will put the .nomedia system file back into empty folders by itself, but you want it to see your media files first.
A better way, though a little slower, is to use an app like ES File Explorer to search the directories for .nomedia and delete them as they show up. Again you have to search the SD card separately from the rest of the phone's memory. And again you have to tell the phone to rescan for media when you're done. Using ES File Explorer has the advantage of not encouraging the phone to rescan when the card is still unmounted and inadvertently putting .nomedia into it, which has happened to me.
Last note is relevant only to me, I expect. This problem was happening every time I used an app to sync iTunes with my phone using a USB cable. When I switched to iSyncr with WiFi, it stopped happening.