Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

escape apostrophe in text field

Status
Not open for further replies.

earle

Technical User
Jan 23, 2000
2
US
How do you escape an apostrophe in a text string?<br>
<br>
For example, using:<br>
String = &quot;Can't escape apostophe&quot;.<br>
<br>
When update/inserting a record with the above string in the field being updated, it errors.<br>
<br>
I've tried replacing the one apostrophe with 2 apostrophes ala Oracle. and I've tried using the MySQL escape character &quot;\&quot; such that &quot; ' &quot; was replaced with &quot; \' &quot;. Neither escape sequence worked. <br>
<br>
What now?<br>
Ed
 
Sorry, I'm using PHP. But the problem was solved when I truned on the enable-magic-quotes function in PHP.<br>
<br>
Thanks<br>
Ed
 
how would you solve it without enable-magic-quotes? Karl Blessing aka kb244{fastHACK}
kblogo.jpg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top