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
BedrockMission!

Learn More

View all

Sign in to view all badges

escaping single quotes of query...

Avatar

Avatar
Level 1
nif-S0eiaB
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
nif-S0eiaB
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
View profile
nif-S0eiaB
Level 1

15-05-2008

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

Replies

Avatar

Avatar
Affirm 1
Level 2
atta707
Level 2

Likes

0 likes

Total Posts

30 posts

Correct Reply

2 solutions
Top badges earned
Affirm 1
View profile

Avatar
Affirm 1
Level 2
atta707
Level 2

Likes

0 likes

Total Posts

30 posts

Correct Reply

2 solutions
Top badges earned
Affirm 1
View profile
atta707
Level 2

15-05-2008

try using escape() global function call on the string before
sending it over to the server.



ATTA

Avatar

Avatar
Level 1
nif-S0eiaB
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
nif-S0eiaB
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
View profile
nif-S0eiaB
Level 1

15-05-2008

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?