Add Database::open call in Database::select_db method
Add Database::open call in Database::insert_id method
Fix regular expression matching in Database::query method