# Why I failed to use the \foreach command to connect the points?

I have a collection of points and I want use tikz package to connect them by using the \foreach command to scan all the data. But I failed :( Here is a mwe

\documentclass[tikz,border=10pt]{standalone}
\begin{document}
\begin{tikzpicture}
\foreach \mx/\my/\mz in {(1,1)/(2,2)/(3,3)}{
\draw \my--\my--\mz;
}
\end{tikzpicture}
\end{document}


I wonder why I failed and how to solve it. Thanks.

You have to hide the commas from the TikZ parser otherwise it thinks that the array is (1,1)/(2,2)/(3,3). Also you are missing the closing brace of the body of the loop.
\foreach \mx/\my/\mz in {{(1,1)}/{(2,2)}/{(3,3)}}{\draw \my--\my--\mz;}