# Prevent mysql\_real\_escape\_string() twice

**URL:** <https://forum.kirupa.com/t/prevent-mysql-real-escape-string-twice/303447>\
**Category:** programming\
**Created:** [January 20, 2010, 3:46pm UTC](https://forum.kirupa.com/t/prevent-mysql-real-escape-string-twice/303447 "2010-01-20T15:46:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![IQAndreas](https://avatars.discourse-cdn.com/v4/letter/i/f08c70/32.png) [@IQAndreas](https://forum.kirupa.com/u/IQAndreas)\
**Post date:** [January 20, 2010, 3:46pm UTC](https://forum.kirupa.com/t/prevent-mysql-real-escape-string-twice/303447/1 "2010-01-20T15:46:55Z")

</div>

I am working on a site, and since MS SQL costs money, I am stuck with MySQL, which means running functions as strings (which I am still completely against!)

Now, to avoid SQL injection, I use mysql\_real\_escape\_string(), however, since I am working with Joomla, there is a chance some data I use will be passed around to other functions, and there is a small chance that they too may use the same function for cleaning strings.

Is there any way to know or prevent if a string is “mysql cleaned” twice?
