I have had quite extensive behavioral problems with my son this month I even took him to the doctor to see what was wrong with him and the doctor said it was me

He said I need to stop feeling sorry for him and dicipline him. :x
Example tonight he went to bed and after he had been acting up all day I told my b/f ( might as well be his dad) to deal with him.. My son freaked out, kicked screamed, threw his toys and really disrespected my b/f. So I asked him to apoligise and I was calling Santa.. Well that just made him more upset. He screamed so loud then I think my neighbor is going to think I am killing the poor child and threw himself on the floor AGAIN and put his fingers down his throat untill he threw up, then he screamed louder after he threw up. ( this going on for about 45 minutes of solid screaming) I just walked outside smoked a ciggarette and cried myself. After I walked in my b/f was frantically trying to calm him down with no sucess so my son started hitting himself.. finally he calmly came out and asked me for CANDY!!! ( yea right) I said no and he just fell asleep crying after about 1 1/2 hours now...
I really don't know what to do, I've tried putting him in the corner, he won't stand up, I've tried taking his stuff away, he doesn't care, I have spanked him before but it doesn't get me anywhere.... What is left to do?
Sorry fot the long post..... This was a rant as well