I have seen problems where the key does not talk to the computer security system correctly. There is a transmitter on your key that has to talk to the antenna in your ignition switch. It can be very, very intermittent. Usually the fix is a new switch with a new antenna which will comes with a new key that has to be programmed into the computers on your vehicle. This can be diagnosed with a scanner. you can bring up the key input going in to the PCM. If the key input is not valid, the fuel injectors will not fire and so no fuel goes into the engine.