Check your oil level be sure there's some in there.if so I'm thinking it may be fuel injection so a injector may be caught up and be needed to replace if not motor might be going but font jump to that the a option can't tell unless under hood honestly.
Have someone do a compression test or a leak down test. That knocking sound is usually indicative of worn main bearings and rod bearings.
higher octane fuel, and dump a can of Seafoam in the tank next time you fill up.
My mustang did the same thing, but it was after a tune (handheld bama tune).
Ok so I recently got my first car and I had to fix it
I switched spark wires and plugs, alternator, battery and other stuff. What I noticed is that when I first start my car, drive it a lil and accelerate it will make a knocking sound. I have to do it slowly until the car is all warmed up already and then the knocking sound mostly goes away. But there is times when I try to get some good speed, it knocks and goes faster.
Any help?