Fixed error handling of database class

Currently, the code uses different indicators to determine failed queries. For example, an UPDATE query with no affected rows will count as an error, which doesn't make a lot of sense.

It's better to check for real SQL errors. This is done by telling MySQLi to throw exceptions in case of an error. Those exceptions can then be caught and replaced with custom error messages.
Fix error handling of INSERT and DELETE queries
Merge pull request #12 from Jacques1/mysqli-error-handling

Mysqli error handling