Well the first error message results from a failed login attempt, which would indicate that your login data was incorrect. The second may indicate a difficulty communication with the database server, which could also result from a failed login.
Ahhh sorry I should have stated I was logged in at the time.
I had been reading a topic and clicked the back button to return to the active topics when the first error occured. the second error when I was replying to a post and clicked submit.
some of the members are also getting the first error when trying to log in or post a message
You should contact your host then. There's definitely nothing on the code side that would cause this. Maybe the database server is under heavy load or there are some networking issues causing this.