You have a transmission range (TR) sensor that tells the transmission what gear to go in. There is a small chance that is your issue. Other than that, verify your fluid level as ghostima96 says. Lastly, you could have had some kind of internal failure that will require additional diagnosis.
I run into this one a lot. Broken trans pump drive shaft or the splines stripped out of the torque converter. With engine off verify level is about 2 quarts over full, start the engine and recheck trans fluid lvl. If the lvl is still over full by the same amount, its time to pull the transmission.