Title: UNCAUGHT ERROR: CALL TO UNDEFINED FUNCTION MYSQL_ESCAPE_STRING()
Last modified: November 29, 2016

---

# UNCAUGHT ERROR: CALL TO UNDEFINED FUNCTION MYSQL_ESCAPE_STRING()

 *  [lo7](https://wordpress.org/support/users/lo7/)
 * (@lo7)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/uncaught-error-call-to-undefined-function-mysql_escape_string/)
 * Good Evening everyone,
 * My actual configuration
 * MySQL Version : 5.6
    Used Theme : Listify, but problem still persist with other
   themes PLugins : WP Job Manager and many others, but problem encountered with
   every plugins disabled too. Hosting provider : OVH Website URL : [http://onmangeou.fr](http://onmangeou.fr)
   Problem Encountered :
 * Since I tried to add a plugin to my WP, i first encountered an error 500, which
   became in few minutes this message:
 * <b>Notice</b>: Constant WP_DEBUG already defined in <b>/home/onmageourm/www/wp-
   config.php</b> on line <b>86</b>
 * <b>Fatal error</b>: Uncaught Error: Call to undefined function mysql_escape_string()
   in /home/onmageourm/www/wp-content/themes/listifys/functions.php:60 Stack trace:#
   0 /home/onmageourm/www/wp-settings.php(387): include() #1 /home/onmageourm/www/
   wp-config.php(95): require_once(‘/home/onmageour…’) #2 /home/onmageourm/www/wp-
   load.php(39): require_once(‘/home/onmageour…’) #3 /home/onmageourm/www/wp-admin/
   admin.php(31): require_once(‘/home/onmageour…’) #4 /home/onmageourm/www/wp-admin/
   themes.php(10): require_once(‘/home/onmageour…’) #5 {main} thrown in <b>/home/
   onmageourm/www/wp-content/themes/listifys/functions.php</b> on line <b>60</b>
 * I tried to backup my database and reupload fresh WordPress fils apart from wp-
   content folder and wp-config.php, without success
 * I really don’t understand this error, and I’m not really in the mood for a complete
   re-installation
 * If any of you have an idea of how to solve it?
 * Thanks
 * Florent

Viewing 10 replies - 1 through 10 (of 10 total)

 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [9 years, 6 months ago](https://wordpress.org/support/topic/uncaught-error-call-to-undefined-function-mysql_escape_string/#post-8494888)
 * Your server is running PHP version 7. You probably need an update to your theme.
 *  Thread Starter [lo7](https://wordpress.org/support/users/lo7/)
 * (@lo7)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/uncaught-error-call-to-undefined-function-mysql_escape_string/#post-8494899)
 * Dear sterndata,
    Thanks for your fast answer. The fact is that the problem is
   the same with the default themes of WordPress, not only with listify. For example
   with thirtyfifteen I have this error:
 * Notice: Constant WP_DEBUG already defined in /home/onmageourm/www/wp-config.php
   on line 86
 * Fatal error: Uncaught Error: Call to undefined function mysql_escape_string()
   in /home/onmageourm/www/wp-content/themes/thirtyfifteen/functions.php:60 Stack
   trace: #0 /home/onmageourm/www/wp-settings.php(387): include() #1 /home/onmageourm/
   www/wp-config.php(95): require_once(‘/home/onmageour…’) #2 /home/onmageourm/www/
   wp-load.php(39): require_once(‘/home/onmageour…’) #3 /home/onmageourm/www/wp-
   admin/admin.php(31): require_once(‘/home/onmageour…’) #4 /home/onmageourm/www/
   wp-admin/themes.php(10): require_once(‘/home/onmageour…’) #5 {main} thrown in/
   home/onmageourm/www/wp-content/themes/thirtyfifteen/functions.php on line 60
 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [9 years, 6 months ago](https://wordpress.org/support/topic/uncaught-error-call-to-undefined-function-mysql_escape_string/#post-8494944)
 * **thirtyfifteen **is not a WordPress standard theme.
 * Change the theme to twentysixteen.
 * You mentioned OVH. Is this a VPS or shared hosting? If a VPS, what operating 
   system are you using?
 * > Notice: Constant WP_DEBUG already defined in /home/onmageourm/www/wp-config.
   > php on line 86
 * You want two WP_DEBUG lines in your wp-config.php file. Remove one to make this
   notice go away.
 *  Thread Starter [lo7](https://wordpress.org/support/users/lo7/)
 * (@lo7)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/uncaught-error-call-to-undefined-function-mysql_escape_string/#post-8494969)
 * The problem is the same with thirtysixteen:
 * Fatal error: Uncaught Error: Call to undefined function mysql_escape_string()
   in /home/onmageourm/www/wp-content/themes/twentysixteen/functions.php:60 Stack
   trace: #0 /home/onmageourm/www/wp-settings.php(387): include() #1 /home/onmageourm/
   www/wp-config.php(95): require_once(‘/home/onmageour…’) #2 /home/onmageourm/www/
   wp-load.php(39): require_once(‘/home/onmageour…’) #3 /home/onmageourm/www/wp-
   admin/admin.php(31): require_once(‘/home/onmageour…’) #4 /home/onmageourm/www/
   wp-admin/themes.php(10): require_once(‘/home/onmageour…’) #5 {main} thrown in/
   home/onmageourm/www/wp-content/themes/twentysixteen/functions.php on line 60
 * Furthermore, I realised I’m not longer able to proceed to updates from BO, there’s
   automatically an error that occur.
 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [9 years, 6 months ago](https://wordpress.org/support/topic/uncaught-error-call-to-undefined-function-mysql_escape_string/#post-8494976)
 * Please answer my question about your hosting.
 * What do you mean by “updates from BO”?
 *  Thread Starter [lo7](https://wordpress.org/support/users/lo7/)
 * (@lo7)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/uncaught-error-call-to-undefined-function-mysql_escape_string/#post-8494981)
 * OVH is a shared hosting. I opened a ticket and they sent me here :/
 * By updates from BO, I mean that if I click on “update theme” for twentysixteen
   for example, I get an error.
 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [9 years, 6 months ago](https://wordpress.org/support/topic/uncaught-error-call-to-undefined-function-mysql_escape_string/#post-8494993)
 * The problem is that they need to install different PHP libraries for mysql with
   PHP7. This is not a wordpress problem. It’s server configuration issue. Please
   go back to OVH and ask them to either drop you back to PHP 5.6 or install the
   correct libraries for mysql with PHP 7.
 *  Thread Starter [lo7](https://wordpress.org/support/users/lo7/)
 * (@lo7)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/uncaught-error-call-to-undefined-function-mysql_escape_string/#post-8495005)
 * Thanks sterndata,
    I contact OVH and I’ll post here if problem is solved.
 * Thanks again for you help
 *  [ericluque](https://wordpress.org/support/users/ericluque/)
 * (@ericluque)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/uncaught-error-call-to-undefined-function-mysql_escape_string/#post-8583370)
 * Easy to fix fellas !!
 * Open the function.php and change mysql_escape_string() ( that is out of code)
   to mysqli_escape_string().
 * Yes, stupid, but happens !!
 *  [angelmaria](https://wordpress.org/support/users/angelmaria/)
 * (@angelmaria)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/uncaught-error-call-to-undefined-function-mysql_escape_string/#post-8857405)
 * Dear ericluque, thank you very much for sharing that answer. It help me fix that
   same problem that was driving me nuts for the last few days and my hosting provider
   was unable to answer. The WordPress community is awesome. Keep the good work!

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘UNCAUGHT ERROR: CALL TO UNDEFINED FUNCTION MYSQL_ESCAPE_STRING()’ is 
closed to new replies.

## Tags

 * [MySQL](https://wordpress.org/support/topic-tag/mysql/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 10 replies
 * 4 participants
 * Last reply from: [angelmaria](https://wordpress.org/support/users/angelmaria/)
 * Last activity: [9 years, 3 months ago](https://wordpress.org/support/topic/uncaught-error-call-to-undefined-function-mysql_escape_string/#post-8857405)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
