Car won't start

I have a 2004 BMW 545i and my car will not start the only signal I'm getting is a yellow key with a line through it prior to this My key wouldn't unlock my car unless I was very close to it. Could this be the problem my key fob will inlock my doors but once I put it in the ignition it will not turn on no lights will come on inside the car only at the dashboard and like I said the only thing that is reading on the dashboard is a yellow key with a line through it I've seen tutorials about replacing the battery but if that's not really what the cause of the no start I rather not try it what do you think I thought it was my car battery but I had it checked out and it's okay