How to use correctly 只要? I want to ask if this sentence is acceptable: 


  只要我还头疼，就不能去上课。


As I only saw sentences with 只要 in which the condition brings about a result (poisitive) but here the result is negative. Is it a correct sentence?
Yes, it is acceptable.  

For example, 

只要有人在说话，就不要插嘴。
As long as someone is talking, do not intervene.

只要下雨，我们就不去了。
As long as it rains, we will not go.

只要客户不满意，我们就不会停止服务。
If customers are not satisfied, we will not stop the service.