public static function cleanValue($value)
    {
        if (function_exists('mysqli_real_escape_string') && self::isConnected()) {
            return mysqli_real_escape_string(self::$_connection['id'], $value);
        } else {
            return addslashes($value);
        }
    }
public static function cleanValue($value)
    {
        if (function_exists('mysqli_real_escape_string') && self::isConnected()) {
            return mysqli_real_escape_string(self::$_connection['id'], $value);
        } else {
            return addslashes($value);
        }
    }
public static function cleanValue ( $ value ) { if ( function_exists ( 'mysqli_real_escape_string' ) && self :: isConnected ( ) ) { return mysqli_real_escape_string ( self :: $ _connection [ 'id' ] , $ value ) ; } else { return addslashes ( $ value ) ; } }
This function will clean a string using the `mysqli_real_escape_string` function
taking into account the current database character encoding. Note that this
function does not encode _ or %. If `mysqli_real_escape_string` doesn't exist,
`addslashes` will be used as a backup option

@param string $value
The string to be encoded into an escaped SQL string
@return string
The escaped SQL string
This function will clean a string using the mysqli_real_escape_string function taking into account the current database character encoding . Note that this function does not encode _ or % . If mysqli_real_escape_string doesn t exist addslashes will be used as a backup option