DETAILS
I\'d like to make use of mysql\'s spatial extension, so I am trying to store longitude and latitude in a mysql table of datatype POINT using
Note that parameterizing queries is not (simple) string replacement. In your code your query parameter is put in a string literal which will be kept untouched.
Try this:
$location = 'POINT(' . $latitude . " " . $longitude . ')';
$sql = "INSERT INTO my_geodata SET location = PointFromText(:location)";
Spatial extensions aren't designed for latitude and longitude yet, they are designed for Cartesian coordinates. The distance functions don't take into account the curvature of the earth so always give wrong results. Quite sad I know...