Oooh.. I had a problem like this before. 'cept the teacher was 25 and I was.. 16ish. It hurts to know that it won't work out. Sure, you can joke about itto your friends and then they'd just laugh at you... but Student + Teacher = bad.
If staff finds out that he IS having a relationship with a teacher, he'd get fired. And he'd be sad. >_>; My advice is to find another person to o0gle after; I'm sure there are guys who are o0gling after you that you might think is cute or something. Start weening yourself away from that teacher (i.e. stop asking for extra help, stop visiting him after class, stop trying to grab his attention, etc.). Chances are that he's interested in someone else or is already married.
It's still good to be friends though. Just don't get too crushed because of him.