I would start small, you can do this and begin working towards a text based rpg as well.
First: write a choose your own adventure story
Second: code the story in straight html
From there take it step by step closer to an rpg by adding in php/mysql features slowly one at a time.