News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Martynas Jusevicius' Blog:
Calculating great-circle distance in MySQL and Propel
May 01, 2008 @ 16:08:27

In a new post today, Martynas Jusevicius shows how to combine a little SQL magic with the Propel framework to fins the distance between two places:

Eventually the simple distance formula that I have blogged about turned out to be too inaccurate, even for locations within city bounds. I needed to use a formula to calculate great-circle distance which takes into account that the Earth is a sphere.

He includes the SQL to pull the data in the right format and the PHP code (using Propel) to reproduce it without having to write it by hand (complete with the bind variables to help with security and consistency).

1 comment voice your opinion now!
great circle distance mysql propel framework sql


blog comments powered by Disqus

Similar Posts

Eirik Hoem's Blog: Why Delphi for PHP should have used Prado instead of VCL

NetTuts.com: Advanced CodeIgniter Profiling With XHProf

Matt Curry's Blog: Free CakePHP E-Book - Super Awesome Advanced CakePHP Tips

The Code of a Ninja: Salt, Hash and Store Passwords Securely with Phpass

Fabien Potencier: Packing a Symfony full-stack Framework Application in one File - Introduction


Community Events





Don't see your event here?
Let us know!


wordpress podcast configure refactor developer testing community release list interview laravel opinion framework introduction code install threedevsandamaybe series unittest language

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework