> For the complete documentation index, see [llms.txt](https://mariadb.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_escape_string.md).

# mysql\_escape\_string

## Syntax

```c
unsigned long mysql_escape_string(char * to,
                                  const char * from,
                                  unsigned long);
```

## Description

Escapes a string using the default character set.

{% hint style="danger" %}
This function is deprecated and will be discontinued. Please use [mysql\_real\_escape\_string()](/docs/connectors/mariadb-connector-c/api-functions/mysql_real_escape_string.md) instead.
{% endhint %}

## See Also

* [mysql\_real\_escape\_string()](/docs/connectors/mariadb-connector-c/api-functions/mysql_real_escape_string.md)

{% @marketo/form formId="4316" %}
