There could be many reasons from age factors to diet and etc.
U should 1st consult a doctor if its happening all the time and since few days.
Make sure u have good calcium diet in ur daily life,drink water in good ratio,and also try massaging coconut oil or edihum oil in ur knees..
It's something that you have to consult a doctor for as it may not just a weakness.