It looks to me that you are having
knee injury ( there can be a ligament damage or
meniscus injury) it can be confirmed after showing to a
orthopaedic surgeon andMRI. If MRI shows any injury then treatment can be done accordingly. Till that time you should not do any exercises, and all gym has to be stopped, apply ice to knee and also compression bandage.