Title: mysql_real_escape_string
Last modified: August 22, 2016

---

# mysql_real_escape_string

 *  Resolved [motopress](https://wordpress.org/support/users/motopress/)
 * (@motopress)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/mysql_real_escape_string/)
 * We get the Warning “mysql_real_escape_string() expects parameter 1 to be string,
   array given in /wp-db.php on line 1036”
    It happens when we restore post from
   trash with wp_debug enabled. Fix it please in next update while this corrupts
   or ajax requests.
 * [https://wordpress.org/plugins/simple-history/](https://wordpress.org/plugins/simple-history/)

Viewing 15 replies - 1 through 15 (of 18 total)

1 [2](https://wordpress.org/support/topic/mysql_real_escape_string/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/mysql_real_escape_string/page/2/?output_format=md)

 *  Plugin Author [Pär Thernström](https://wordpress.org/support/users/eskapism/)
 * (@eskapism)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/mysql_real_escape_string/#post-5611729)
 * Try version 2.0.7 that I just released. Let me know if issue is fixed.
 *  [Haavard](https://wordpress.org/support/users/haurs/)
 * (@haurs)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/mysql_real_escape_string/#post-5611936)
 * We’re also getting a similar error like this.
 * Warning: mysql_real_escape_string() expects parameter 1 to be string, array given
   in /home/xnlnemeg/public_html/wp-includes/wp-db.php on line 1036
 * We’re running version 2.0.10.
 *  Plugin Author [Pär Thernström](https://wordpress.org/support/users/eskapism/)
 * (@eskapism)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/mysql_real_escape_string/#post-5611938)
 * Haavard: when do you get this error? Any specific thing you’ve done before, like
   editing a post or installing a plugin?
 *  [royaltask](https://wordpress.org/support/users/royaltask/)
 * (@royaltask)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/mysql_real_escape_string/#post-5611977)
 * Same here:
    `Warning: mysql_real_escape_string() expects parameter 1 to be string,
   array given in /homepages/11/d14454/htdocs/website/wp-includes/wp-db.php` on 
   line 1040
 * I love your plugin but it crashes now all my sites. Happens when I go into gerneral
   options and permalinks, also other suff like read write, when saving. its crashes
   dthe admin i am so unpappy now.
 *  [royaltask](https://wordpress.org/support/users/royaltask/)
 * (@royaltask)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/mysql_real_escape_string/#post-5611978)
 * I have newest version from today and latest version of wordpress.
 *  Plugin Author [Pär Thernström](https://wordpress.org/support/users/eskapism/)
 * (@eskapism)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/mysql_real_escape_string/#post-5611982)
 * royaltask: I need some more info, like when exactly does this happen? When you
   load the log, when you install a plugin, when you edit a post? The more details
   I get the eaiser I can fix it. Also: on what WP version, what PHP version and
   what MySQL-version?
 *  [stephmoreau](https://wordpress.org/support/users/stephmoreau/)
 * (@stephmoreau)
 * [11 years ago](https://wordpress.org/support/topic/mysql_real_escape_string/#post-5612008)
 * I get the same issue. So far i’ve only encountered in on the “Permalink Setting”
   page (options-permalink.php)
    I get 12 errors Warning: mysql_real_escape_string()
   expects parameter 1 to be string, array given in /MY_SITE_PATH/wp-includes/wp-
   db.php on line 1036
 * Currently running WP 4.1.1, PHP 5.4.25 MySQL 5.5.42
 *  Plugin Author [Pär Thernström](https://wordpress.org/support/users/eskapism/)
 * (@eskapism)
 * [11 years ago](https://wordpress.org/support/topic/mysql_real_escape_string/#post-5612009)
 * thanks for the update. will investigate…
 *  Plugin Author [Pär Thernström](https://wordpress.org/support/users/eskapism/)
 * (@eskapism)
 * [11 years ago](https://wordpress.org/support/topic/mysql_real_escape_string/#post-5612010)
 * Unfortunately I can’t get this error myself. Anyone else getting this that can
   give more information?
 * [@royaltask](https://wordpress.org/support/users/royaltask/) and [@stephmoreau](https://wordpress.org/support/users/stephmoreau/):
   does this happen every time you visit options/permalink, just when you save, 
   always, sometimes…? I need more info to figure this one out. Thanks.
 *  [stephmoreau](https://wordpress.org/support/users/stephmoreau/)
 * (@stephmoreau)
 * [11 years ago](https://wordpress.org/support/topic/mysql_real_escape_string/#post-5612011)
 * I get the errors everytime i go to the permalinks pages. And only the permalinks
   page, no other page is affected by the error messages.
 *     ```
       Warning: mb_check_encoding() expects parameter 1 to be string, array given in /home/xtargets/public_html/wp-includes/wp-db.php on line 2378
       Warning: mysql_real_escape_string() expects parameter 1 to be string, array given in /home/xtargets/public_html/wp-includes/wp-db.php on line 1094
       ```
   
 * I disbaled all my other plugins on the live site to see if any of them were affecting
   but I still get the errors.
 * (upgraded to WP 4.2)
 *  Plugin Author [Pär Thernström](https://wordpress.org/support/users/eskapism/)
 * (@eskapism)
 * [11 years ago](https://wordpress.org/support/topic/mysql_real_escape_string/#post-5612012)
 * Ok, so if only Simple History is enabled then you get those errors?
 * And if you also disable Simple History, then you get no errors at all?
 * Sorry if asking perphaps obvious things, but I just wanna be sure that’s the 
   case 🙂
 *  [stephmoreau](https://wordpress.org/support/users/stephmoreau/)
 * (@stephmoreau)
 * [11 years ago](https://wordpress.org/support/topic/mysql_real_escape_string/#post-5612013)
 * Excactly…
    It’s not problem, ask away.
 * I did however manage to clear the errors when I change my theme. Seems that there
   must be something in my theme that is affecting the plugin :S.
 *  [stephmoreau](https://wordpress.org/support/users/stephmoreau/)
 * (@stephmoreau)
 * [11 years ago](https://wordpress.org/support/topic/mysql_real_escape_string/#post-5612014)
 * I found that these lines causing the issues (v2.0.28 SimpleHistory.php ln: 110-
   111)
 *     ```
       add_filter("gettext", array($this, 'filter_gettext'), 20, 3);
       add_filter("gettext_with_context", array($this, 'filter_gettext_with_context'), 20, 4);
       ```
   
 * But i’m still not sure how these 2 lines and my theme are causing the php warnings,
   will continue to work on this.
 *  Plugin Author [Pär Thernström](https://wordpress.org/support/users/eskapism/)
 * (@eskapism)
 * [11 years ago](https://wordpress.org/support/topic/mysql_real_escape_string/#post-5612015)
 * Thanks for helping me debug this! Any chance I could get a copy of the theme 
   causing the problem?
 *  [The Dro](https://wordpress.org/support/users/desaad37/)
 * (@desaad37)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/mysql_real_escape_string/#post-5612026)
 * Just in case this will help you debug, today I went into my SETTINGS>GENERAL 
   and made a change. When I hit SAVE it gives me this error:
 *     ```
       Warning: mysql_real_escape_string() expects parameter 1 to be string, object given in ~/html/wp-includes/wp-db.php on line 1094
   
       Warning: mysql_real_escape_string() expects parameter 1 to be string, object given in ~/html/wp-includes/wp-db.php on line 1094
   
       Warning: mysql_real_escape_string() expects parameter 1 to be string, object given in ~/html/wp-includes/wp-db.php on line 1094
   
       Warning: mysql_real_escape_string() expects parameter 1 to be string, object given in ~/html/wp-includes/wp-db.php on line 1094
   
       Warning: Cannot modify header information - headers already sent by (output started at ~/html/wp-includes/wp-db.php:1094) in  ~/html/wp-includes/pluggable.php on line 1196
       ```
   
 * (I removed my full path for security purposes)
 * When I disable the Simple History plugin it lets me save the settings without
   any errors.
 * -dro

Viewing 15 replies - 1 through 15 (of 18 total)

1 [2](https://wordpress.org/support/topic/mysql_real_escape_string/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/mysql_real_escape_string/page/2/?output_format=md)

The topic ‘mysql_real_escape_string’ is closed to new replies.

 * ![](https://ps.w.org/simple-history/assets/icon.svg?rev=3225008)
 * [Simple History – Track, Log, and Audit WordPress Changes](https://wordpress.org/plugins/simple-history/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/simple-history/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/simple-history/)
 * [Active Topics](https://wordpress.org/support/plugin/simple-history/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/simple-history/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/simple-history/reviews/)

 * 18 replies
 * 6 participants
 * Last reply from: [Pär Thernström](https://wordpress.org/support/users/eskapism/)
 * Last activity: [10 years, 10 months ago](https://wordpress.org/support/topic/mysql_real_escape_string/page/2/#post-5612031)
 * Status: resolved