I have owned all these cameras and based on my experience - D90>D5000>D3100
No contest, D90 is the best among the 3, but between d5000 and d3100...I'll get d5000 over d3100 simply because of better image quality ang color depth. I agree with ddefy of the advabtages of d3100 over d5000 but it really depends on your needs. If you are into using the video, mas better ang d3100. But if you'll focus more on photography, go for d5000. Other advantages of d3100 over d5000 doesn't really matters (again, depending on your needs)...
@old skul
advantage ng d3100 sa d5000, larger screen, 1080p video, mas maliit at magaan, higher ISO, 14.2 MP
advantage ng d90 sa d5000, madami
imo, sa budget mo p30k, ok na d3100 with kitlens, add kna lang ng konti may pambili kpa ng flash
higher ISO - I never go above 1600 due to noise
14.2 MP - Max that I'll be printing maybe is a poster size, not really aiming to print a billboard
magaan and maliit - for me this is a disadvantage, mas masarap sa kamay ang d5000 compared sa d3100, mas stable sya
larger screen vs flipout screen, depending on your choice
with a 30k budget, I suggest getr a used d90 and save up to buy lens, then flash, then tripod