Add some helper functions to database.php, mikes queries to admin.php, and correct some syntax errors.