1. Storing data in a database does not "remove" line breaks. The line breaks are most likely still there - however, line breaks are ignored in HTML. If this is the case, you need to replace them with the <br> element.
2. You should not be using the mysql_* functions. They are long outdated, and the deprecation process has begun. You should use mysqli or PDO instead - read more about choosing an API.
3. You should not be using htmlentities() when storing your data in the database. You should preserve the actual data in the database, and use htmlentities when you display the information on your webpage instead.
(This will also solve the problem of having to use html_entity_decode() and stripslashes() when you retrieve the data.)
(As a side note, if you are using htmlentities as a means of preserving "special characters," you need to be using the proper character set instead. UTF-8 is almost always the best choice. Make sure your webpage, scripts, database, and database connection are set up to use UTF-8.)
4. Your query:
$query=mysql_query(insert into special values($data)); # this will cause a parse error. your query needs to be quoted. # you don't specify which columns you are inserting into. ## if there is more than one column, this will cause a mysql error. ## if there is only one column, your database needs to be better designed. # inside your query, you don't quote the $data you are inserting. this will cause a mysql error.
# should be: $query = "INSERT INTO `special` ( `col_name` ) VALUES ( '$data' )";