Checked error level prior to preparing any queries and added a check in connect to stop attempting to connect after 2 failed attempts.
Merge branch 'master' of https://github.com/Jonnycake/SimpleSite