You've got a comma after the last data field which is causing the query to fail. Also, you should refer to the $_POST array variables as $_POST['field1']
and not $_POST[field1]
Try
$sql = "INSERT INTO data (field1, field2, field3, field4, field5, field6)
VALUES ('".$_POST['field1']."','".$_POST['field2']."','".$_POST['field3']."','".$_POST['field4']."',
'$field5','$escaped_value')";
Effectively, mysql_real_escape_string
is the least of your problems. :)