Question!

I have about a week before my period, and it says I'm not ovulating anymore.. my boyfriend and I had unprotected sex yesterday but he pulled out. I don't know, I've been told you can't get pregnant unless your ovulating?!