# Single vs double quotes into mysql

**URL:** https://forum.kirupa.com/t/single-vs-double-quotes-into-mysql/327269
**Category:** Uncategorized
**Created:** [February 17, 2012, 10:29am UTC](https://forum.kirupa.com/t/single-vs-double-quotes-into-mysql/327269 "2012-02-17T10:29:24Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jerome\_chevreau](https://avatars.discourse-cdn.com/v4/letter/j/53a042/32.png) [@jerome\_chevreau](https://forum.kirupa.com/u/jerome_chevreau)
#### Post date: [February 17, 2012, 10:29am UTC](https://forum.kirupa.com/t/single-vs-double-quotes-into-mysql/327269/1 "2012-02-17T10:29:24Z")

</div>

Hi there,

I would like to know if it is better to save data with single and double quotes into the mysql.  
What i am currently doing is that all single quotes get converted into double quotes.  
it start beign annoying when it comes to commenting as if people write “text text ‘something’” i have a problem to really know what i should output.

i also try to convert single quotes into html entities but then when i output with htmlentities the double quotes string is not showing into an input :). on solution which i am not sure is that i allow all and just use mysql\_real\_escape\_string.  
Am i on the right way??

Does anybody have any suggestion.

Ps: how can i also protect agains dodggy data coming in ie. javascript.

Thanks a lot for all the help,

Regards,

Jerome
