# Problem with $dbh-\>quote in CGI script

**URL:** https://forum.kirupa.com/t/problem-with-dbh-quote-in-cgi-script/283637
**Category:** programming
**Created:** [March 9, 2009, 2:23pm UTC](https://forum.kirupa.com/t/problem-with-dbh-quote-in-cgi-script/283637 "2009-03-09T14:23:52Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![iamhere](https://avatars.discourse-cdn.com/v4/letter/i/c57346/32.png) [@iamhere](https://forum.kirupa.com/u/iamhere)
#### Post date: [March 9, 2009, 2:23pm UTC](https://forum.kirupa.com/t/problem-with-dbh-quote-in-cgi-script/283637/1 "2009-03-09T14:23:52Z")

</div>

Hi,  
I’m trying to develop a website which will accept user written input in a form and will store it in a MySQL database, and will have no problems if the user written text has a ’ in it. For this I was referred to this site:

[http://www.developer.com/db/print.php/10920\_2184681\_6](http://www.developer.com/db/print.php/10920_2184681_6)

and it looks pretty easy, what I have to do.  
The problem is, when I use $dbh-\>quote, from my error logs I can see that it is substituting a ’ with \’, ie. “O’Reilly” becomes “O\'Reilly”, instead of “O’Reilly”, and I can’t tell why.

Can someone help?

Thanks.
