Post and Pages editing works now.

Added feature to throw database error in debug mode.