What I am trying to do is I have entries in the database which have a lat/long stored with them. I want to calculate the distance between users lat/long and entries lat/long
I did this a few weeks ago.
This link is your best bet:
http://code.google.com/apis/maps/articles/phpsqlsearch.html
Even if you don't use their API, their PHP and SQL query helped really well.