I see 2 potentials points of failure in your code. The first thing is if the users email or the product ID returns no results (because the the email or product ID specified in the URL didn't exist in the database) then the condition in the while() loop will not evaluate to true.
The other point of failure is what if one query returned results but the other didnt? That would also cause the condition to evaluate to false.