Yes, in both cases the two sentences mean the same thing. However the order of the words can cause confusion. For example:
The King said the wine tastes funny to me.
Is the king saying that the wine tastes funny to him? Or did he say, "The wine tastes funny," to me? Of course, if you mean the first, then as an indirect quote it should be:
The King said the wine tastes funny to him
Still even if the second, it's nice to make things clear to the reader by writing it as:
The King said to me (that) the wine tastes funny.
Direct quotes are less confusing because the actual quote is set off by quotation marks, but again it's nice to be clear by putting an adverb close to the verb it modifies.
The King said to me, "This wine tastes funny," right before he died from poisoning.
Note that direct quotes that appear in the middle of sentences routinely have commas or other punctuation both before and after the quote.
He said, "Direct quotations should be set off by both quotation marks and commas," but everyone ignored him.