First off, none of this has anything to do with a database, so forget about all database related things for the moment.
htmlspecialchars() takes certain symbols ( &, ", ', <, > ) and converts them to their respective HTML entities.
htmlentities() does the same thing except with more characters.
get_html_translation_table() does nothing useful for all practical purposes... all the data inside that function is a predefined hard-coded variable within PHP, you can't change it, and it gets set automatically when you call the function.
If you're trying to escape characters to put into MySQL, use mysql_escape_chars() instead.