Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

escaping single quotes of query...

nif-S0eiaB
Level 1
Level 1
hi there,



i am working on my first flex 3 php project and have come up
against a bit of a bump.

i have a php file which basically takes a string parameter
from flex which is the sql statement i want to run, it runs it and
returns the data.



my problem arises whenever i use single quotes in a query
e.g. select CONCAT(firstname,' ',lastname) as name from users

if i pass this in i get this error:

Error #1088: The markup in the document following the root
element must be well-formed.



i have tested and found this happens whenever i try passing
single quotes as part of any parameter to the php page.



i have also tried to escape the ways i know how (\' or ''),
but this isn't working and i can't seem to find any info on how to
do this.



does anyone know how i can go about doing this?



thanks a mil',

nikki
2 Replies
atta707
Level 2
Level 2
try using escape() global function call on the string before
sending it over to the server.



ATTA
nif-S0eiaB
Level 1
Level 1
hi atta,



thanks for the quick reply. it makes absolute sense, but
unfortunately, doesn't seem to work.

do you think there is some specific format that i need to
encode this stuff to when passing params with HTTPService
object?