471,092 Members | 1,432 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,092 software developers and data experts.

sql standard: \' or ''

CSN
I heard that the sql standard for escaping quotes is
'', and not \'. Is this true?

BTW, PHP's pg_escape_string returns \' and not ''.


__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs
http://hotjobs.sweepstakes.yahoo.com/careermakeover

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 23 '05 #1
4 1315
CSN wrote:
I heard that the sql standard for escaping quotes is
'', and not \'. Is this true?

BTW, PHP's pg_escape_string returns \' and not ''.


Are you sure about that?

~# php -r "print pg_escape_string(\"I can't believe that quotes are
escaped improperly\n\");"
I can''t believe that quotes are escaped improperly

Greg

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #2
CSN wrote:
I heard that the sql standard for escaping quotes is
'', and not \'. Is this true?

BTW, PHP's pg_escape_string returns \' and not ''.


Are you sure about that?

~# php -r "print pg_escape_string(\"I can't believe that quotes are
escaped improperly\n\");"
I can''t believe that quotes are escaped improperly

Greg

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #3
CSN

--- Gregory Wood <gw***@ewebengine.com> wrote:
CSN wrote:
I heard that the sql standard for escaping quotes

is
'', and not \'. Is this true?

BTW, PHP's pg_escape_string returns \' and not ''.


Are you sure about that?

~# php -r "print pg_escape_string(\"I can't believe
that quotes are
escaped improperly\n\");"
I can''t believe that quotes are escaped improperly

Greg


Weird. Via cgi it escapes them as \' and via cli as
'', for me anyway.



__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs
http://hotjobs.sweepstakes.yahoo.com/careermakeover

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 23 '05 #4
CSN

--- Gregory Wood <gw***@ewebengine.com> wrote:
CSN wrote:
I heard that the sql standard for escaping quotes

is
'', and not \'. Is this true?

BTW, PHP's pg_escape_string returns \' and not ''.


Are you sure about that?

~# php -r "print pg_escape_string(\"I can't believe
that quotes are
escaped improperly\n\");"
I can''t believe that quotes are escaped improperly

Greg


Weird. Via cgi it escapes them as \' and via cli as
'', for me anyway.



__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs
http://hotjobs.sweepstakes.yahoo.com/careermakeover

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 23 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

25 posts views Thread by Magnus Lie Hetland | last post: by
29 posts views Thread by David Eng | last post: by
43 posts views Thread by Steven T. Hatton | last post: by
24 posts views Thread by noridotjabi | last post: by
132 posts views Thread by Frederick Gotham | last post: by
26 posts views Thread by Rick | last post: by
270 posts views Thread by jacob navia | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.