Use the right tool for the right job 
PHP has how many functions built in? Hundreds, if not thousands. For literally ANYTHING there’s a function prepared.
If you want to put a string of characters from the clientside (GET, POST, COOKIE) into a SQL query, why would you want to use addslashes() (or htmlspecialchars()) when mysql_real_escape_string() (or any similar function for different database engines) is available? Addslashes() does not provide a completely secure way of making user input safe for use in queries, and neither does htmlspecialchars().
Htmlspecialchars() makes possibly unsafe input safe for outputting to a publicly viewable page. For example, it disarms XSS attempts (thought that was htmlspecialchars() at least, or perhaps htmlentities()).
Addslashes() is a generic function that can be used in many cases, but should NEVER be relied on when trying to make user input ‘safe’ for processing.