On 11 January 2011 00:49, kseesee <[email protected]> wrote: > I am new to PHP and I'm definitely not an escape/java guru. I never > did figure out how to escape an apostrophe in my sql, or how to build > a proper paramaterized query, and I know this is not the forum for > those burning questions. Any suggestions would be great though. > > Can you explain how you found that oddball ’ apos when all I gave you > was the link > http://teedeck.com/maps/markers.asp > I was using this query to view my XML > http://teedeck.com/maps/markersxml.php?lat=42.971800000000002&lng=-81.167500000000004&radius=50
I opened your page in Firefox and used Firebug to show the XML retrieved by the page. The apostrophe is shown as a diamond, indicating that it doesn't fit into the encoding used. Firefox tends not to crash with invalid XML, so it's a useful testbed. Ordinary straight apostophes should be escaped with \ (so an address might be 50 St Philip\'s Road). In many cases this may not be necessary, but it will always work so it's not a bad general rule. Curly apostrophes should be encoded as entities: ’ (including the & and the semicolon). BUT most xml encodings can't cope with these oddball entities, so you need to fool it by splitting that into &rsquo; The browser will see & and interpret that as & -- that's immediately followed by rsquo; and the browser knows that ’ is a right-single quote. [You're right: you found the answer to your second question] -- You received this message because you are subscribed to the Google Groups "Google Maps API V2" 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.
