Pretty URLs

Hi all. I have made a simple CMS in which all pages are saved in database. On frontend, each page is viewed using the ID given in url like "?page_id=2". What I want to know how can I make the URL pretty!

For example, if a page with ID=2 is an "about us" page. I have specified "about-us" as permalink for this page in the database.

Now how do I change TO ????


Maybe this could help you?