in that case I dont see why should you use htmlentities or htmlspecialchars. these should be used when you DON'T want to allow users to input HTML tags, causing it to display <b>text</b> instead of text
I highly recommend using it tho, because malicious users might try to input javascript in your page using it.
as for the sql if should suffice to escape it with addslashes (mysql_real_escape_string() is the best choice actually) don't do anything with htmlspecialchars() or htmlentities() before entering data into the DB or you'll only get headaches.
also, remember to check the magic_quotes_gpc settings in php.ini. If it's enabled it will escape everything coming from GET, POST or COOKIE beforehand, so you'd be escaping the strings twice if you don't un-escape them with stripslashes() first (or not modify at all, in case you decide to use addslashes(), because you'd be wasting processing time).