[EMAIL PROTECTED] wrote:

You can use addslashes and stripslashes when inserting and selecting
respectively.  addslashes will turn your name into O\'connel.  and
stripslashes will bring it back to the displayable format.

check out
php.net/addslashes
php.net/stripslashes



An alternative is to use mysql_escape(). If your PHP server has "magicquotes" turned
on you won't need to take any action. I did some notes for students on this topic once,
they're at http://www.scit.wlv.ac.uk/~jphb/sst/basics/quoting.html


You can somtimes get quite surprising results by typing a query such as "O'Malley" into
a web based query facility.


hth
Jeff


Steve Buehler <[EMAIL PROTECTED]> To: PHP <[EMAIL PROTECTED]>, mysql <[EMAIL PROTECTED]> cc: 11/07/2003 11:30 Subject: single quotes in database AM





I am using PHP/MySQL and am having a problem. We have some names and addresses in the database that have single quotes in them. For instance. There is a town around here called "Lee's Summit". Also names like "O'connel". When I pull from the database it skips these because of the quotes. I know there is something that I have seen before about this, but can't find it now. Can anybody help me? I really hope this makes since because I am sick today and am having a hard time thinking straight. Is it something that I will have to fix when putting things into the database? I am hoping on being able to fix this when going in and when coming out of the database so that I don't have to go back and redo all the ones that are already in the database.

Thanks
Steve


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]










--
From Peter Burden, [EMAIL PROTECTED]
http://www.scit.wlv.ac.uk/~jphb



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to