Skip to content

Instantly share code, notes, and snippets.

@nguyenvanduocit
Last active November 23, 2015 12:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nguyenvanduocit/8ba2cd9ca4ba8bfca233 to your computer and use it in GitHub Desktop.
Save nguyenvanduocit/8ba2cd9ca4ba8bfca233 to your computer and use it in GitHub Desktop.
/**
* Real escapes, using mysql_real_escape_string() or addslashes()
*
* @see mysql_real_escape_string()
* @see addslashes()
* @access private
*
* @param string $string The string to escape.
*
* @return string Escaped string.
*/
function _real_escape( $string ) {
if ( is_resource( $this->dbhs['global_r'] ) ) {
if ( $this->use_mysqli ) {
return mysqli_real_escape_string( $this->dbhs['global_r'] , $string );
} else {
return mysql_real_escape_string( $string, $this->dbhs['global_r'] );
}
} else {
return addslashes( $string );
}
}
@nrbtushar
Copy link

hi,
can please upload full file.

@nrbtushar
Copy link

Hi,
I have upgrade my wp site to 4.3. Now shardb showing following error

WordPress database error: Table 'wp_myblog_global.wp_options' doesn't exist for query SHOW FULL COLUMNS FROM `wp_options` made by do_action('admin_init'), call_user_func_array, bp_admin_init, do_action('bp_admin_init'), call_user_func_array, bp_setup_updater, bp_version_updater, bp_version_bump, bp_update_option, update_blog_option, update_option, SharDB->query, referer: http://xxxx.com

can you please help me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment