I wanted to make a URL shortener for me to use for my blog, and for links on twitter...
I used to have one that was created by Brian Cray which can be found here.
It is a very simple set of PHP files and a MYSQL Database.
That's now old news. I have converted my old MYSQL Database and started using YOURLS
This URL Shortener provides much more, including tracking info and custom URLs
For example, if you add a + to the end of one of my shortened URLs you can see the stats for the link.
eg if you go to http://g.rff.me/4q+ you can see the click through info for the link to http://g.rff.me/4q
Both of these shorteners work well, it just depends on whether you want more info or not.
Hope that helps...
Griffmiester