all of a sudden my car won't start

my 2006 altima was running with a little lag when I sped up the rev went higher then supposed to but then drops down where it's supposed to. I also noticed my check engine light turn on and off but the light was on for 2 days and never came back. when I checked they said it had something to do with the idle system so I thought no biggie all of a sudden my car won't start it sounds like it's trying I changed the starter my batterys good and just wanted to know what I could be I was suggested crank shaft sensor or cam shaft sensor I was even told a throttle body please help!!

crwdns2934089:0crwdne2934089:0 crwdns2934093:0crwdne2934093:0

crwdns2934109:0crwdne2934109:0

crwdns2889612:0crwdne2889612:0 0

crwdns2944067:02crwdne2944067:0:

@gmulaa23 does your engine turn over with the starter? Does it have spark? Does it have fuel? What engine size is this?

crwdns2934271:0crwdnd2934271:0crwdne2934271:0

If it starts when stone cold but dies or shuts off when hot. That is almost always a crank angle sensor. Sometimes they don't throw a code. However as OT said, give us some more info and we can help.

crwdns2934271:0crwdnd2934271:0crwdne2934271:0

crwdns2934285:0crwdne2934285:0