This will depend on the reason for your knee giving way. Giving way can be treated with physiotherapy to strengthen muscles in conditions like ACL injuries or arthritis, however the knee may need surgical management if there is major instability in the knee.