I cannot do that because I read only one record from mysql:
$points=array();
while ($row=...){
$points[]=$row;
}
I do:
$row = mysql_fetch_array($result);
$points = $row['Points'];
//$points is a string such as "(1.1,9.4),(1.15,9.4),(1.2,9.35)"
I must transform this string in array: is that correct ?
After I can do json_encode and call the function.
On 23 oct, 04:34, Jake <[email protected]> wrote:
> On Oct 22, 6:46 pm,phicarre<[email protected]> wrote:
>
> > I like your first option but I try to do that:
> > $encoded_points=json_encode($points);
> > something = ???
> > echo "make_markers (something);";
>
> > and have the code of the function "make_markers" in another page
> > because this function is used several times !
>
> it's
>
> $encoded_points=json_encode($points);
> echo "
> make_markers($enocoded_points);
> ";
>
> Once you encode it it's Javascript code, there's no need for any other
> transformation. as long as your array is sequential, starting with
> zero, shouldn't be a problem. I've done it many times. Without seeing
> your code, I can't tell you what you are doing wrong. It could be
> anything. It may not even be related to json_encode.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" 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-api?hl=en
-~----------~----~----~----~------~----~------~--~---