<p><code>mysql_real_escape_string</code> and <code>addslashes</code> are both used to escape data before the database query, so what's the difference? (This question is not about parametrized queries/PDO/mysqli)</p>

It seems that
```
mysql_real_escape_string
```
is binary-safe - the documentation states:
If binary data is to be inserted, this function must be used.
I think it's probably safer to always use
```
mysql_real_escape_string
```
than addslashes.