On 26 December 2010 03:04, Sheridan <[email protected]> wrote:
> $lat = $_GET['lat'];
> $long = $_GET['lng'];
> $type = $_GET['type'];"
>
> "$query = sprintf("INSERT INTO markers " .
>         " (id, name, address, lat, lng, type ) " .
>         " VALUES (NULL, '%s', '%s', '%s', '%s', '%s');",
>         mysql_real_escape_string($name),
>         mysql_real_escape_string($address),
>         mysql_real_escape_string($lat),
>         mysql_real_escape_string($lng),
>         mysql_real_escape_string($type));"
> becomes
> $query = sprintf("INSERT INTO table1 " .
>         " (id, name, lat, long, type ) " .
>         " VALUES (NULL, '%s', '%s', '%s', '%s', '%s');",
>         mysql_real_escape_string($name),
>         //mysql_real_escape_string($address),
>         mysql_real_escape_string($lat),
>         mysql_real_escape_string($long),
>         mysql_real_escape_string($type));"

It's not clear what you're doing, really. It's far easier to use lat
and lng everywhere (that is, as variable names and column names), for
two reasons:
(a) Google use lat and lng whenever they refer to latitude and longitude;
(b) "long" is a reserved word in many contexts, including Javascript and MySQL.

Don't use "long" at all. Make everything "lng": var lng in Javascript;
$lng in php; database column lng. Or, use lon instead in the same way.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to