It is narrated from Sayyiduna Abdullah bin Salam (may Allah be pleased with him) that the Prophet (peace and blessings be upon him) said: "There is no prayer for one who turns this way and that."
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 13974