I'm not going to take the time to fill in all the steps right now (I'll get back to you later if you need that done) but you've got (most of) your information correct and I'll give you some steps to work through.
First, answer the following question. Your coordinate system likely has the projectile at a height h above the origin at the start of the problem:
Yes! If so then your equation is and your final height y is 0. Solve for t.
No! Then you have your origin at the point where the projectile was fired, so the final height of the projectile when it hits the ground, y, is -h. So . Solve for t.
You now have the time of flight. Now plug that t value into the equation
which is the corrected x equation.