Added improved db.php