Created some methods in Database class.
Completed database.class.php. Untested.