It seems to me that it would be much more efficient to have a formula to evaluate needed experience, rather than have a (large) table that is queried each and every time the page is loaded.
This link seems informative:
http://www.serebii.net/games/exp.shtml
