My wifi will connect only sometimes and even if it connects, there won't be any internet. My mobile data works fine and wifi also did 2 weeks back. I am really regretting buying this phone.
If your Wi-Fi was working fine two weeks ago, that heavily implies a software issue. Try a reboot of the phone, and if that doesn't reset the Wi-Fi, then I recommend backing up your data and performing a factory reset. That will restore your Wi-Fi to normal.