Not ever mistake invalidates the Prayer. It depends on the nature of the mistake. For example if your Wuzu was invalid then the Salaah is invalid or if you miss any basic obligatory acts like Niyyat, Takbeeratul Ehraam, Qiyam, Rokoo' or Sojood then Salaah is invalid. You can write clearly what was the mistake then the answer will come accordingly.Wassalam