Change to error handling to return proper HTTP response code + pretty result

Suppressed  "warning" level messages generated by msqli because we are
already in the habit of checking the error ourselves.

Return a custom message instead that is more compact and does not reveal
server implementation details to the client (such as giving the line
number and location on disk).