You have quite a few errors, and im confused on what your doing. Why are you trying to escape those quotes? Just use single qoutes.The correct syntax for what you are doing is:
$query = "INSERT INTO `table` 'fieldname1' VALUES ('" . mysql_real_escape_string($line1) . "')";
You dont need a semi colon ( ; ) at the end of queries, although you are supposed to write them that way, since they are single function things it doesnt matter so I dont recommend it.